Skip to content

Commit

Permalink
Merge pull request #110 from marcgurevitx/order-of-ops-2
Browse files Browse the repository at this point in the history
Added tests for order of operations in lists and maps
  • Loading branch information
JoeStrout authored Nov 13, 2023
2 parents 0b5d6fe + e5be783 commit c803034
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions TestSuite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1933,9 +1933,9 @@ print p("CALLABLE", {"f": @sum3}).f(
p("ARG1", "a"),
p("ARG2", "b"),
p("ARG3", "c") )
p("CALLABLE", @sum3) p("ARG1", "a"),
p("ARG2", "b"),
p("ARG3", "c")
p("CALLABLE", @sum3) p("ARG1", "a"),
p("ARG2", "b"),
p("ARG3", "c")
----------------------------------------------------------------------
CALLABLE
ARG1
Expand All @@ -1945,4 +1945,29 @@ abc
CALLABLE
ARG1
ARG2
ARG3
ARG3
======================================================================
==== Order of operations: list and map literals
p = function(first, second)
print first
return @second
end function
print [ p("ELEM_1", 1), p("ELEM_2", 2), p("ELEM_3", 3) ]
m = { p("KEY_1", 10): p("VALUE_1", 15), p("KEY_2", 20): p("VALUE_2", 25), p("KEY_3", 30): p("VALUE_3", 35) }
print m[10]
print m[20]
print m[30]
----------------------------------------------------------------------
ELEM_1
ELEM_2
ELEM_3
[1, 2, 3]
KEY_1
VALUE_1
KEY_2
VALUE_2
KEY_3
VALUE_3
15
25
35

0 comments on commit c803034

Please sign in to comment.