Skip to content

Commit

Permalink
Tests: Add some tests for invalid number literals (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
catamorphism authored Mar 1, 2025
1 parent 662bd57 commit 3e6b7e1
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions test/tests/functions/number.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,105 @@
"src": "hello {|0.42e+1| :number}",
"exp": "hello 4.2"
},
{
"src": "hello {00 :number}",
"exp": "hello {|00|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {042 :number}",
"exp": "hello {|042|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1. :number}",
"exp": "hello {|1.|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1e :number}",
"exp": "hello {|1e|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1E :number}",
"exp": "hello {|1E|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1.e :number}",
"exp": "hello {|1.e|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1.2e :number}",
"exp": "hello {|1.2e|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1.e3 :number}",
"exp": "hello {|1.e3|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1e+ :number}",
"exp": "hello {|1e+|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1e- :number}",
"exp": "hello {|1e-|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {1.0e2.0 :number}",
"exp": "hello {|1.0e2.0|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "hello {foo :number}",
"exp": "hello {|foo|}",
Expand Down

0 comments on commit 3e6b7e1

Please sign in to comment.