wip operator tests
This commit is contained in:
@@ -21,7 +21,8 @@ resource_1 "strlit1" "strlit2" {
|
||||
for5 = { for v in local.list : v => v }
|
||||
for6 = [ for v in local.list : v if v < 3 ]
|
||||
func1 = is_number("123")
|
||||
cond1 = pred() ? 1 : "foobar"
|
||||
cond1 = (1 == 2) ? 1 : "foobar"
|
||||
bin1 = ((1+2)%3)*4
|
||||
esc1 = "\" \t \UFF11FF22 \uFFFF \n"
|
||||
|
||||
nested_resource_1 {
|
||||
|
||||
50
test/corpus/operators.txt
Normal file
50
test/corpus/operators.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
==================
|
||||
unary operator -
|
||||
==================
|
||||
|
||||
foo = -3
|
||||
|
||||
---
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(operation
|
||||
(unary_operation (expr_term (literal_value (numeric_lit)))))))))
|
||||
|
||||
==================
|
||||
unary operator !
|
||||
==================
|
||||
|
||||
foo = !true
|
||||
|
||||
---
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(operation
|
||||
(unary_operation (expr_term (literal_value (bool_lit)))))))))
|
||||
|
||||
==================
|
||||
binary operators +
|
||||
==================
|
||||
|
||||
foo = 1+2
|
||||
|
||||
---
|
||||
|
||||
(config_file
|
||||
(body
|
||||
(attribute
|
||||
(identifier)
|
||||
(expression
|
||||
(operation
|
||||
(binary_operation
|
||||
(expr_term (literal_value (numeric_lit)))
|
||||
(expr_term (literal_value (numeric_lit)))))))))
|
||||
|
||||
Reference in New Issue
Block a user