Skip to content

Commit

Permalink
Tests: fix 'literal select' tests for :number and :integer (#1046)
Browse files Browse the repository at this point in the history
* Tests: fix 'literal select' tests for :number and :integer

* Change more tests

* Fix fallback syntax in expected output

* Fix variable fallback

* Fix more fallbacks
  • Loading branch information
catamorphism authored Mar 1, 2025
1 parent 0d3f5a5 commit c4971d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions test/tests/functions/integer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,32 @@
},
{
"src": "literal select {1 :integer select=exact}",
"exp": "literal select {1}"
"exp": "literal select 1"
},
{
"src": ".local $bad = {exact} {{variable select {1 :integer select=$bad}}}",
"exp": "variable select {1}",
"exp": "variable select {|1|}",
"expErrors": [{ "type": "bad-option" }]
},
{
"src": "variable select {1 :integer select=$bad}",
"params": [{ "name": "bad", "value": "exact" }],
"exp": "variable select {1}",
"exp": "variable select {|1|}",
"expErrors": [{ "type": "bad-option" }]
},
{
"src": ".local $sel = {1 :integer select=exact} .match $sel 1 {{literal select {$sel}}} * {{OTHER}}",
"exp": "literal select {1}"
"exp": "literal select 1"
},
{
"src": ".local $sel = {1 :integer select=exact} .local $bad = {$sel :integer} .match $bad 1 {{ONE}} * {{operand select {$bad}}}",
"exp": "operand select {1}",
"exp": "operand select {$sel}",
"expErrors": [{ "type": "bad-option" }, { "type": "bad-selector" }]
},
{
"src": ".local $sel = {1 :integer select=$bad} .match $sel 1 {{ONE}} * {{variable select {$sel}}}",
"params": [{ "name": "bad", "value": "exact" }],
"exp": "variable select {1}",
"exp": "variable select {$sel}",
"expErrors": [{ "type": "bad-option" }, { "type": "bad-selector" }]
}
]
Expand Down
12 changes: 6 additions & 6 deletions test/tests/functions/number.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,32 +187,32 @@
},
{
"src": "literal select {1 :number select=exact}",
"exp": "literal select {1}"
"exp": "literal select 1"
},
{
"src": ".local $bad = {exact} {{variable select {1 :number select=$bad}}}",
"exp": "variable select {1}",
"exp": "variable select {|1|}",
"expErrors": [{ "type": "bad-option" }]
},
{
"src": "variable select {1 :number select=$bad}",
"params": [{ "name": "bad", "value": "exact" }],
"exp": "variable select {1}",
"exp": "variable select {|1|}",
"expErrors": [{ "type": "bad-option" }]
},
{
"src": ".local $sel = {1 :number select=exact} .match $sel 1 {{literal select {$sel}}} * {{OTHER}}",
"exp": "literal select {1}"
"exp": "literal select 1"
},
{
"src": ".local $sel = {1 :number select=exact} .local $bad = {$sel :number} .match $bad 1 {{ONE}} * {{operand select {$bad}}}",
"exp": "operand select {1}",
"exp": "operand select {$sel}",
"expErrors": [{ "type": "bad-option" }, { "type": "bad-selector" }]
},
{
"src": ".local $sel = {1 :number select=$bad} .match $sel 1 {{ONE}} * {{variable select {$sel}}}",
"params": [{ "name": "bad", "value": "exact" }],
"exp": "variable select {1}",
"exp": "variable select {$sel}",
"expErrors": [{ "type": "bad-option" }, { "type": "bad-selector" }]
},
{
Expand Down

0 comments on commit c4971d0

Please sign in to comment.