JangSing / JSON_Parser

JSON Parser (Mini Project for Test Driven Development)
0 stars 0 forks source link

No non-well-formed JSON was tested #4

Open chaosAD opened 9 years ago

chaosAD commented 9 years ago

Don't only focus on only well-formed JSON. How about non-well-formed ones.

For example:

{
  "key"   : {^}
}

or

{
  "age"   : 23

There are many non-well-formed combinations. I have shown only 2. Please test them all.

chaosAD commented 9 years ago

For the following JSON,

{
  "age"   : 
}

the error your code should dump should look like the following:

Error at line [2]: expected value after ':' for "age".
  "age"   : 
   ~~~    ^

The information can be found in the tokens that you gathered. Neng will place the info. However in your test, you must fill in yourself for each token.