-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor fixtures for serde tests
PR-URL: #236 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
- Loading branch information
Showing
21 changed files
with
264 additions
and
199 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'sparse array', | ||
value: [1, undefined, 3], | ||
serialized: '[1,,3]' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
module.exports = [].concat( | ||
require('./number'), | ||
require('./string'), | ||
require('./array'), | ||
require('./object') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'binary numbers', | ||
value: 10, | ||
serialized: '0b1010' | ||
}, | ||
{ | ||
name: 'octal numbers', | ||
value: 83, | ||
serialized: '0o123' | ||
}, | ||
{ | ||
name: 'hexadecimal numbers', | ||
value: 0xff, | ||
serialized: '0xff' | ||
}, | ||
{ | ||
name: 'hexadecimal numbers in upper case', | ||
value: 0xAF, | ||
serialized: '0xAF' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'object with whitespaces', | ||
value: { key: 42 }, | ||
serialized: '{ key:\n\t42 }' | ||
}, | ||
{ | ||
name: 'object with single-quoted keys', | ||
value: { key: 42 }, | ||
serialized: '{\'key\': 42}' | ||
}, | ||
{ | ||
name: 'object with double-quoted keys', | ||
value: { key: 42 }, | ||
serialized: '{"key": 42}' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'Unicode code point escapes', | ||
value: '💚💛', | ||
serialized: '\'\\u{1F49A}\\u{1F49B}\'' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'empty array', | ||
value: [], | ||
serialized: '[]' | ||
}, | ||
{ | ||
name: 'array of integers', | ||
value: [1, 2, 3], | ||
serialized: '[1,2,3]' | ||
}, | ||
{ | ||
name: 'nested arrays', | ||
value: ['outer', ['inner']], | ||
serialized: '[\'outer\',[\'inner\']]' | ||
}, | ||
{ | ||
name: 'Marcus array', | ||
value: [ | ||
'Marcus Aurelius', | ||
'AE127095', | ||
[ | ||
'1990-02-15T00:00:00.000Z', | ||
'Rome' | ||
], | ||
[ | ||
'Ukraine', | ||
'Kiev', | ||
'03056', | ||
'Pobedy', | ||
'37', | ||
'1', | ||
'158' | ||
] | ||
], | ||
serialized: '[\'Marcus Aurelius\',\'AE127095\',' + | ||
'[\'1990-02-15T00:00:00.000Z\',\'Rome\'],' + | ||
'[\'Ukraine\',\'Kiev\',\'03056\',\'Pobedy\',\'37\',\'1\',\'158\']]' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'true', | ||
value: true, | ||
serialized: 'true' | ||
}, | ||
{ | ||
name: 'false', | ||
value: false, | ||
serialized: 'false' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
module.exports = [].concat( | ||
require('./boolean'), | ||
require('./number'), | ||
require('./string'), | ||
require('./null'), | ||
require('./undefined'), | ||
require('./array'), | ||
require('./object') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'null', | ||
value: null, | ||
serialized: 'null' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'integer', | ||
value: 42, | ||
serialized: '42' | ||
}, | ||
{ | ||
name: 'negative integer', | ||
value: -3, | ||
serialized: '-3' | ||
}, | ||
{ | ||
name: 'float', | ||
value: 1e100, | ||
serialized: '1e+100' | ||
}, | ||
{ | ||
name: 'float with comma', | ||
value: 3.14, | ||
serialized: '3.14' | ||
}, | ||
{ | ||
name: 'small float', | ||
value: 1e-3, | ||
serialized: '0.001' | ||
} | ||
]; |
Oops, something went wrong.