Skip to content

Commit

Permalink
Test if fist character in string is multibyte
Browse files Browse the repository at this point in the history
  • Loading branch information
arp242 committed May 15, 2024
1 parent 8bdabb2 commit 1f4a07a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions tests/valid/string/start-mb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"s1": {"type": "string", "value": "§"},
"s2": {"type": "string", "value": "§"},
"s3": {"type": "string", "value": "§"},
"s4": {"type": "string", "value": "§"},
"s5": {"type": "string", "value": "§"},
"s6": {"type": "string", "value": "§"},
"s7": {"type": "string", "value": "§"}
}
13 changes: 13 additions & 0 deletions tests/valid/string/start-mb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Start first line with a multibyte character.
#
# https://github.com/marzer/tomlplusplus/issues/190
s1 = "§"
s2 = '§'
s3 = """\
§"""
s4 = """
§"""
s5 = """§"""
s6 = '''
§'''
s7 = '''§'''
4 changes: 2 additions & 2 deletions toml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func TestSize(t *testing.T) {
return nil
}

if inf.Size() > 1024 {
t.Errorf("larger than 1K: %s (%fK)", path, float64(inf.Size())/1024)
if inf.Size() > 2048 {
t.Errorf("larger than 2K: %s (%fK)", path, float64(inf.Size())/1024)
}
return nil
})
Expand Down

0 comments on commit 1f4a07a

Please sign in to comment.