1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: fix some warnings in preparation for -W test-self

This commit is contained in:
Delyan Angelov
2021-01-31 11:05:17 +02:00
parent 89bf48e3ba
commit 978359a6fc
7 changed files with 72 additions and 45 deletions

View File

@@ -86,7 +86,7 @@ fn test_character_unescape() {
assert lines['newline'].str() == 'new\nline'
assert lines['tab'].str() == '\ttab'
assert lines['backslash'].str() == 'back\\slash'
assert lines['quotes'].str() == '\"quotes\"'
assert lines['quotes'].str() == '"quotes"'
assert lines['slash'].str() == '/dev/null'
}
@@ -169,6 +169,7 @@ fn test_parse_user() {
assert false
User2{}
}
println(u2)
u := json2.decode<User>(s) or {
assert false
User{}
@@ -249,14 +250,15 @@ fn test_struct_in_struct() {
fn test_encode_map() {
expected := '{"one":1,"two":2,"three":3,"four":4}'
numbers := {
'one': json2.Any(1)
'two': json2.Any(2)
'one': json2.Any(1)
'two': json2.Any(2)
'three': json2.Any(3)
'four': json2.Any(4)
'four': json2.Any(4)
}
out := numbers.str()
assert out == expected
}
/*
fn test_parse_map() {
expected := {