Skip to content

Commit

Permalink
Add tests for changes due to #885 (name/literal equality)
Browse files Browse the repository at this point in the history
  • Loading branch information
catamorphism committed Oct 10, 2024
1 parent e9fc136 commit dec91ac
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/tests/functions/string.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
"type": "unresolved-variable"
}
]
},
{
"description": "NFC: keys are normalized",
"src": ".local $x = {\u1E0A\u0323 :string} .match $x \u1E0A\u0323 {{Not normalized}} \u1E0C\u0307 {{Normalized}} * {{Wrong}}",
"expErrors": [{"type": "duplicate-variant"}]
},
{
"description": "NFC: keys are normalized",
"src": ".local $x = {\u1E0A\u0323 :string} .match $x \u1E0C\u0307 {{Right}} * {{Wrong}}",
"exp": "Right"
}
]
}
27 changes: 27 additions & 0 deletions test/tests/syntax.json
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,33 @@
{
"src": "{{trailing whitespace}} \n",
"exp": "trailing whitespace"
},
{
"description": "NFC: literals are not normalized",
"src": "\u1E0A\u0323",
"exp": "\u1E0A\u0323"
},
{
"description": "NFC: variables are compared to each other as-if normalized; decl is non-normalized, use is",
"src": ".local $\u0044\u0323\u0307 = {foo} {{{$\u1E0c\u0307}}}",
"exp": "foo"
},
{
"description": "NFC: variables are compared to each other as-if normalized; decl is normalized, use isn't",
"src": ".local $\u1E0c\u0307 = {foo} {{{$\u0044\u0323\u0307}}}",
"exp": "foo"
},
{
"description": "NFC: variables are compared to each other as-if normalized; decl is normalized, use isn't",
"src": ".input {$\u1E0c\u0307} {{{$\u0044\u0323\u0307}}}",
"params": [{"name": "\u1E0c\u0307", "value": "foo"}],
"exp": "foo"
},
{
"description": "NFC: variables are compared to each other as-if normalized; decl is non-normalized, use is",
"src": ".input {$\u0044\u0323\u0307} {{{$\u1E0c\u0307}}}",
"params": [{"name": "\u0044\u0323\u0307", "value": "foo"}],
"exp": "foo"
}
]
}

0 comments on commit dec91ac

Please sign in to comment.