1
0
mirror of https://github.com/json-iterator/go.git synced 2024-12-12 09:03:48 +02:00
Commit Graph

355 Commits

Author SHA1 Message Date
Tao Wen
fb382c0ec1 fix -, 2017-06-29 20:40:07 +08:00
Tao Wen
09cb1d9236 #81 handle field name conflict properly 2017-06-29 20:34:40 +08:00
Tao Wen
e6c24947ee array is just like struct, one element case special for interface{ 2017-06-29 18:58:40 +08:00
Tao Wen
a6673c983a slice embedded in struct will not be optimized by interface{} 2017-06-29 18:52:03 +08:00
Tao Wen
ec7b40d104 update ignore 2017-06-29 18:45:20 +08:00
Tao Wen
84fa033353 #80 fix the case when embedded struct ptr is nil 2017-06-29 18:45:11 +08:00
Tao Wen
4e608af2c7 #80 fix embedded builtins 2017-06-29 10:45:29 +08:00
Tao Wen
3458ccdb20 Merge pull request #83 from thockin/output_tests
Methods on aliased types are not valid map keys
2017-06-29 09:43:12 +08:00
Tim Hockin
45ccfb031f Methods on aliased types are not valid map keys 2017-06-28 09:38:15 -07:00
Tao Wen
545a32f2a1 #76 support TextUnmarshal 2017-06-29 00:14:55 +08:00
Tao Wen
08dbc98040 #76 fix UnmarshalJSON 2017-06-28 23:55:32 +08:00
Tao Wen
82dabdcdbf #77 support -, 2017-06-28 23:47:32 +08:00
Tao Wen
76e62088df #78 not null pointer is considered not empty 2017-06-28 23:39:46 +08:00
Tao Wen
faaa59222a #79 fix string tag on string field 2017-06-28 23:37:10 +08:00
Tao Wen
91ef89a6a2 WIP: MarshalIndent 2017-06-28 23:22:05 +08:00
Tao Wen
3e3caf9184 Merge pull request #82 from thockin/output_tests
Huge updates to output tests
2017-06-28 23:20:59 +08:00
Tim Hockin
03a2daaeee Add a test for caseless unmarshal 2017-06-28 08:11:38 -07:00
Tim Hockin
4652ac6cc2 Add output tests for embedded types 2017-06-28 08:11:38 -07:00
Tim Hockin
8a9f2b9179 Add output test for manual text marshalers 2017-06-28 08:11:33 -07:00
Tim Hockin
0db2d74de8 Add output test for manual json marshalers 2017-06-28 08:11:02 -07:00
Tim Hockin
d6ef711c18 Better errors in output_tests 2017-06-28 07:48:55 -07:00
Tim Hockin
628fedf63c Add output tests for map keys with TextMarshal 2017-06-28 07:48:55 -07:00
Tim Hockin
5bb7a1f7af Add output test for 'string' tag 2017-06-28 07:48:55 -07:00
Tim Hockin
c2c9981062 catch errors in output_tests 2017-06-28 07:48:55 -07:00
Tim Hockin
e40d614037 Add output test for json tag field names 2017-06-28 07:48:55 -07:00
Tim Hockin
1589ab2fd7 Add output tests for omitempty 2017-06-28 07:48:49 -07:00
Tim Hockin
97ee4ad4a2 Reorganize output_tests for structs
As I added more and more cases, I found the dir structure hard to
navigate.  The new structure follows how you read a type:

   e.g. struct { F *string } -> struct/ptr_string

This exposed some redundant cases and some missing cases, too.
2017-06-27 19:51:13 +01:00
Tim Hockin
f09f778ca9 Reorganize output_tests for slices
As I added more and more cases, I found the dir structure hard to
navigate.  The new structure follows how you read a type:

   e.g. []*string -> slice/ptr_string

This exposed some redundant cases and some missing cases, too.
2017-06-27 19:21:17 +01:00
Tim Hockin
9fc858b117 Reorganize output_tests for maps
As I added more and more cases, I found the dir structure hard to
navigate.  The new structure follows how you read a type:

e.g. map[string]*string -> map/string/ptr_string

This exposed some redundant cases and some missing cases, too. Now
map[string] is the "main" test case that exercises all the variants of
value types, and the other key types are just to prove that they
basically work.
2017-06-27 19:19:37 +01:00
Tim Hockin
f93d25f8b1 Add output tests for slices of slices 2017-06-27 18:28:52 +01:00
Tim Hockin
7cd7a6cc7c Add output tests for maps of maps/slices/structs 2017-06-27 11:58:07 +01:00
Tim Hockin
7d6c9374e8 Add output test for structs of struct ptrs 2017-06-27 11:46:55 +01:00
Tim Hockin
e16ee7f8ac Add output tests for structs of slices and maps 2017-06-27 11:41:17 +01:00
Tim Hockin
cf6367546b Add output tests for structs of structs 2017-06-27 11:28:17 +01:00
Tao Wen
dc44e85a86 #73 fix interface{} optimization for one ptr field struct and array 2017-06-26 22:37:24 +08:00
Tao Wen
85f7a1b0b3 Merge pull request #74 from thockin/output_tests
Output tests for structs
2017-06-26 21:49:06 +08:00
Tim Hockin
507a446eda Add output_tests for structs of ptrs 2017-06-26 06:09:00 -07:00
Tim Hockin
76eefc25ba Add output_test for empty structs 2017-06-26 05:45:54 -07:00
Tim Hockin
21a16bd252 Add output_tests for structs of builtins 2017-06-26 05:37:47 -07:00
Tao Wen
0c0c9f119f update value proposition 2017-06-26 14:28:03 +08:00
Tao Wen
cf77980493 #71 fixed []byte alias 2017-06-26 14:25:56 +08:00
Tao Wen
7d681fe2c2 #71 fix map key type of string alias 2017-06-26 11:52:22 +08:00
Tao Wen
0c07128d3c #71 sort non string map keys 2017-06-26 10:42:47 +08:00
Tao Wen
f771d32291 #70 decode null to nil for map/slice 2017-06-26 10:20:49 +08:00
Tao Wen
d100b0d41f fix typo 2017-06-26 10:02:45 +08:00
Tao Wen
81e64121ba #71 fix html escape for string alias 2017-06-26 09:57:45 +08:00
Tao Wen
dcc91365ee Merge pull request #72 from thockin/output_tests
Output tests
2017-06-26 08:51:10 +08:00
Tim Hockin
8f3de9c412 Adapt tests to use new Config structs
the unit test uses compatible mode.  The benchmarks measure compat,
default, and fastest.

This still fails for strings and slices and maps all over the place.
2017-06-25 10:29:48 -07:00
Tim Hockin
5d3508979f Add output tests for slices of builtins 2017-06-25 10:00:35 -07:00
Tao Wen
8f8e16b4c2 #63 keep struct field order 2017-06-23 08:21:02 +08:00