Permalink
Browse files

added some semi-parsed tests

  • Loading branch information...
1 parent cea43af commit 224ec2ef0badb96557ef3b469d55c5a90216a165 @tj committed Dec 19, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/parse.js
View
@@ -139,6 +139,14 @@ module.exports = {
'test malformed uri': function(){
qs.parse('{%:%}').should.eql({ '{%:%}': '' });
qs.parse('foo=%:%}').should.eql({ 'foo': '%:%}' });
+ },
+
+ 'test semi-parsed': function(){
+ qs.parse({ 'user[name]': 'tobi' })
+ .should.eql({ user: { name: 'tobi' }});
+
+ qs.parse({ 'user[name]': 'tobi', 'user[email][main]': 'tobi@lb.com' })
+ .should.eql({ user: { name: 'tobi', email: { main: 'tobi@lb.com' } }});
}
// 'test complex': function(){

0 comments on commit 224ec2e

Please sign in to comment.