Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More cleanup + more list operations test.
- Loading branch information
1 parent
f734a45
commit 5b2da13
Showing
6 changed files
with
61 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/test/resources/inkfiles/lists/more-list-operations2.ink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
LIST list1 = (a1), b1, c1 | ||
LIST list2 = a2, b2, c2 | ||
LIST list3 = a3, b3, c3 | ||
VAR vlist = () | ||
|
||
{LIST_ALL(list1)} | ||
{list1} | ||
|
||
~list2 += a1 | ||
~list2 += b2 | ||
|
||
{list2} | ||
count:{LIST_COUNT(list2)} | ||
|
||
~list2 += c2 | ||
|
||
max:{LIST_MAX(list2)} | ||
min:{LIST_MIN(list2)} | ||
|
||
// Equality | ||
~temp t = list2 | ||
{t == list2} | ||
{t == (a1, b2, c2)} | ||
{t != list2} | ||
|
||
//emptiness | ||
{list3: not empty| empty} | ||
|
||
~vlist = (a2) | ||
{ vlist } | ||
{ LIST_ALL(vlist) } | ||
|
||
range:{ LIST_RANGE(list2, 1, 2)} | ||
{ LIST_RANGE(list2, a1, a3)} | ||
|
||
subtract:{(a1,b1,c1) - (b1)} | ||
|
||
~ SEED_RANDOM(10) | ||
random:{LIST_RANDOM(t)} | ||
|
||
listinc:{(a1) + 1} | ||
|
||
|
1 change: 1 addition & 0 deletions
1
src/test/resources/inkfiles/lists/more-list-operations2.ink.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"inkVersion":21,"root":[["ev",{"VAR?":"list1"},"LIST_ALL","out","/ev","\n","ev",{"VAR?":"list1"},"out","/ev","\n","ev",{"VAR?":"list2"},{"VAR?":"a1"},"+",{"VAR=":"list2","re":true},"/ev","ev",{"VAR?":"list2"},{"VAR?":"b2"},"+",{"VAR=":"list2","re":true},"/ev","ev",{"VAR?":"list2"},"out","/ev","\n","^count:","ev",{"VAR?":"list2"},"LIST_COUNT","out","/ev","\n","ev",{"VAR?":"list2"},{"VAR?":"c2"},"+",{"VAR=":"list2","re":true},"/ev","^max:","ev",{"VAR?":"list2"},"LIST_MAX","out","/ev","\n","^min:","ev",{"VAR?":"list2"},"LIST_MIN","out","/ev","\n","ev",{"VAR?":"list2"},"/ev",{"temp=":"t"},"ev",{"VAR?":"t"},{"VAR?":"list2"},"==","out","/ev","\n","ev",{"VAR?":"t"},{"list":{"list1.a1":1,"list2.b2":2,"list2.c2":3}},"==","out","/ev","\n","ev",{"VAR?":"t"},{"VAR?":"list2"},"!=","out","/ev","\n","ev",{"VAR?":"list3"},"/ev",[{"->":".^.b","c":true},{"b":["^ not empty",{"->":"0.85"},null]}],[{"->":".^.b"},{"b":["^ empty",{"->":"0.85"},null]}],"nop","\n","ev",{"list":{"list2.a2":1}},"/ev",{"VAR=":"vlist","re":true},"ev",{"VAR?":"vlist"},"out","/ev","\n","ev",{"VAR?":"vlist"},"LIST_ALL","out","/ev","\n","^range:","ev",{"VAR?":"list2"},1,2,"range","out","/ev","\n","ev",{"VAR?":"list2"},{"VAR?":"a1"},{"VAR?":"a3"},"range","out","/ev","\n","^subtract:","ev",{"list":{"list1.a1":1,"list1.b1":2,"list1.c1":3}},{"list":{"list1.b1":2}},"-","out","/ev","\n","ev",10,"srnd","pop","/ev","\n","^random:","ev",{"VAR?":"t"},"lrnd","out","/ev","\n","^listinc:","ev",{"list":{"list1.a1":1}},1,"+","out","/ev","\n",["done",{"#f":5,"#n":"g-0"}],null],"done",{"global decl":["ev",{"list":{"list1.a1":1}},{"VAR=":"list1"},{"list":{},"origins":["list2"]},{"VAR=":"list2"},{"list":{},"origins":["list3"]},{"VAR=":"list3"},{"list":{}},{"VAR=":"vlist"},"/ev","end",null],"#f":1}],"listDefs":{"list1":{"a1":1,"b1":2,"c1":3},"list2":{"a2":1,"b2":2,"c2":3},"list3":{"a3":1,"b3":2,"c3":3}}} |