mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
toml: ignore CRLF just like LF in line comments, support VTEST_HIDE_OK=1 in tests.
This commit is contained in:
@ -11,3 +11,13 @@ fn test_crlf() {
|
||||
assert value as string == str_value
|
||||
assert value.string() == str_value
|
||||
}
|
||||
|
||||
fn test_crlf_is_parsable_just_like_lf() ? {
|
||||
crlf_content := '# a comment\r\ntitle = "TOML Example"\r\n[database]\r\nserver = "192.168.1.1"\r\nports = [ 8000, 8001, 8002 ]\r\n'
|
||||
all := [crlf_content, crlf_content.replace('\r\n', '\n')]
|
||||
for content in all {
|
||||
res := toml.parse(content) ?
|
||||
assert res.value('title') == toml.Any('TOML Example')
|
||||
assert (res.value('database') as map[string]toml.Any)['server'] ? == toml.Any('192.168.1.1')
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user