diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-23 13:31:35 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-23 13:31:35 -0500 |
| commit | 5d654490bee273bcd6afe612100dafac08199218 (patch) | |
| tree | ae150f3f955faec7affdf841f86b488a73e54327 /tests | |
| parent | 87bc0cfdbddeb550b7d7959c88088ef9658a5e2d (diff) | |
Add first test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/arrays.nl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/arrays.nl b/tests/arrays.nl new file mode 100644 index 00000000..bbe36e42 --- /dev/null +++ b/tests/arrays.nl @@ -0,0 +1,27 @@ +>> arr := [10, 20, 30] += [10, 20, 30] + +>> arr[1] += 10 +>> arr[-1] += 30 + +sum := 0 +for x in arr + sum += x +>> sum += 60 + +str := "" +for i,x in arr + str ++= "({i},{x})" +>> str += "(1,10)(2,20)(3,30)" + +>> arr2 := [10, 20] ++ [30, 40] += [10, 20, 30, 40] + +>> arr2 ++= [50, 60] +>> arr2 += [10, 20, 30, 40, 50, 60] + |
