update formatting

This commit is contained in:
Eric 2024-05-13 15:06:48 +10:00
parent cefbc47367
commit fcacbc4927
No known key found for this signature in database
3 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,4 @@
import std/strutils
func flatten*(s: string): string =
s.replace(" ")
.replace("\n")
s.replace(" ").replace("\n")

View File

@ -189,14 +189,14 @@ suite "json serialization - deserialize":
check deserialized.myint == expected.myint
suite "deserialize from string":
test "deserializes objects from string":
type MyObj = object
mystring: string
myint: int
let expected = MyObj(mystring: "abc", myint: 1)
let myObjJson = """{
let myObjJson =
"""{
"mystring": "abc",
"myint": 1
}"""
@ -209,7 +209,8 @@ suite "deserialize from string":
myint: int
let expected = MyRef(mystring: "abc", myint: 1)
let myRefJson = """{
let myRefJson =
"""{
"mystring": "abc",
"myint": 1
}"""
@ -224,7 +225,8 @@ suite "deserialize from string":
myint: int
let expected = @[MyObj(mystring: "abc", myint: 1)]
let myObjsJson = """[{
let myObjsJson =
"""[{
"mystring": "abc",
"myint": 1
}]"""
@ -237,7 +239,8 @@ suite "deserialize from string":
myint: int
let expected = some MyObj(mystring: "abc", myint: 1)
let myObjJson = """{
let myObjJson =
"""{
"mystring": "abc",
"myint": 1
}"""

View File

@ -4,4 +4,4 @@ import ./json/testPragmas
import ./json/testSerialize
import ./json/testSerializeModes
{.warning[UnusedImport]:off.}
{.warning[UnusedImport]: off.}