add tests for to ndnuon

This commit is contained in:
amtoine 2024-11-13 19:18:17 +01:00
parent 7b6d1acaee
commit 783f711e9f
No known key found for this signature in database
GPG Key ID: 37AAE9B486CFF1AB
2 changed files with 29 additions and 0 deletions

View File

@ -103,3 +103,17 @@ def from_ndnuon_single_object [] {
def from_ndnuon_invalid_object [] {
assert error { '{"a":1' | formats from ndnuon }
}
#[test]
def to_ndnuon_multiple_objects [] {
let result = [{a:1},{a:2},{a:3},{a:4},{a:5},{a:6}] | formats to ndnuon | str trim
let expect = test_data_multiline
assert equal $result $expect "could not convert to NDNUON"
}
#[test]
def to_ndnuon_single_object [] {
let result = [{a:1}] | formats to ndnuon | str trim
let expect = "{a:1}"
assert equal $result $expect "could not convert to NDNUON"
}

View File

@ -103,3 +103,18 @@ def from_ndnuon_single_object [] {
def from_ndnuon_invalid_object [] {
assert error { '{"a":1' | formats from ndnuon }
}
#[test]
def to_ndnuon_multiple_objects [] {
let result = [{a:1},{a:2},{a:3},{a:4},{a:5},{a:6}] | formats to ndnuon | str trim
let expect = test_data_multiline
assert equal $result $expect "could not convert to NDNUON"
}
#[test]
def to_ndnuon_single_object [] {
let result = [{a:1}] | formats to ndnuon | str trim
let expect = "{a:1}"
assert equal $result $expect "could not convert to NDNUON"
}