Skip to content

Json.dump #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test dumping of long arrays
  • Loading branch information
dolik-rce committed Mar 29, 2016
commit 097ea145c54372d1348777381dc2c71ed6c7531f
14 changes: 14 additions & 0 deletions test/array.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/0 "A"
/1 "B"
/2 "C"
/3/0 "D"
/3/1/0 "E"
/3/1/1 "F"
/4 "G"
/5 "H"
/6 "I"
/7 "J"
/8 "K"
/9 "L"
/10 "M"
/11 "N"
8 changes: 7 additions & 1 deletion test/dump.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source test/setup

use Test::More tests 21
use Test::More tests 27
use JSON

test_dump() {
Expand All @@ -26,6 +26,12 @@ test_dump() {
"dumped result contains correct number of keys"

like "$json1" '"x y z": *"spaces"' "keys with spaces work correctly"

json3="$(shuf test/array.data | JSON.dump)"
ok $? "JSON.dump succeeded"

grep -o '"[A-Z]"' <<<"$json3" | sort -c
ok $? "keys are correctly ordered"
}

test_dump normal
Expand Down