Tcl Library Source Code

Check-in [9b5c9460dc]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Test cases for json dumping, null handling
Timelines: family | ancestors | descendants | both | tkt-e4cfcc0f96-ak
Files: files | file ages | folders
SHA1: 9b5c9460dc4b19a0b2f9734fcf02f2c896b0734d
User & Date: andreask 2017-05-30 16:23:40
Context
2017-05-30
16:26
Ticket e4cfcc0f96: fixed handling of null when generating json. Bumped version to 0.3. Closed-Leaf check-in: 70ea88b63e user: andreask tags: tkt-e4cfcc0f96-ak
16:23
Test cases for json dumping, null handling check-in: 9b5c9460dc user: andreask tags: tkt-e4cfcc0f96-ak
16:16
Fix oops in new code for tar seek errors. check-in: 054a65997f user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/yaml/huddle.test.

217
218
219
220
221
222
223











224
225
226
227
228
229
230
  }
}}
    
    set data [json::json2dict $json1]
    set data [huddle compile {dict dd {dict * dict} ee {dict k number * string}}  $data]
    huddle equal $huddle1 $data
} -result {1}












# ... Tests of addStrings ...
#     (Requires introspection of parser state)

test huddle-4.1 "test of huddle set" -body {
    huddle set data_dict dd bb a baa
} -result {HUDDLE {D {dd {D {bb {D {a {s baa} c {s d}}} cc {D {e {s f} g {s h}}}}} ee {D {i {s j} k {s l}}}}}}






>
>
>
>
>
>
>
>
>
>
>







217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
  }
}}
    
    set data [json::json2dict $json1]
    set data [huddle compile {dict dd {dict * dict} ee {dict k number * string}}  $data]
    huddle equal $huddle1 $data
} -result {1}

test huddle-3.5 "test of huddle jsondump - null handling" -body {
    huddle jsondump {HUDDLE null}
} -result {null}

test huddle-3.6 "test of huddle jsondump - dict and null handling" -body {
    huddle jsondump {HUDDLE {D {a {s foo} b null}}}
} -result {{
  "a": "foo",
  "b": null
}}

# ... Tests of addStrings ...
#     (Requires introspection of parser state)

test huddle-4.1 "test of huddle set" -body {
    huddle set data_dict dd bb a baa
} -result {HUDDLE {D {dd {D {bb {D {a {s baa} c {s d}}} cc {D {e {s f} g {s h}}}}} ee {D {i {s j} k {s l}}}}}}