Skip to content

Commit

Permalink
few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Jun 20, 2024
1 parent 3d16bec commit 8a96d2a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
12 changes: 6 additions & 6 deletions hogvm/__tests__/__snapshots__/tuples.hoge
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
["_h", 2, "tuple", 0, 2, "print", 1, 35, 33, 1, 44, 1, 2, "print", 1, 35, 33, 1, 33, 2, 44, 2, 2, "print", 1, 35, 33, 1,
33, 2, 33, 3, 44, 3, 2, "print", 1, 35, 33, 1, 32, "2", 33, 3, 44, 3, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 44, 2, 33,
4, 44, 3, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 33, 4, 44, 2, 44, 2, 33, 5, 44, 3, 2, "print", 1, 35, 33, 1, 33, 2,
33, 3, 44, 3, 36, 0, 33, 1, 45, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 33, 4, 44, 2, 44, 2, 33, 5, 44, 3, 33, 1, 45,
33, 1, 45, 33, 1, 45, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 33, 4, 44, 2, 44, 2, 33, 5, 44, 3, 33, 1, 45, 33, 1, 45,
33, 1, 45, 2, "print", 1, 35, 33, 1, 33, 1, 33, 2, 33, 3, 33, 4, 44, 2, 44, 2, 33, 5, 44, 3, 33, 1, 45, 33, 1, 45, 33,
1, 45, 6, 2, "print", 1, 35, 35]
33, 2, 44, 2, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 44, 3, 2, "print", 1, 35, 33, 1, 32, "2", 33, 3, 44, 3, 2,
"print", 1, 35, 33, 1, 33, 2, 33, 3, 44, 2, 33, 4, 44, 3, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 33, 4, 44, 2, 44, 2,
33, 5, 44, 3, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 44, 3, 36, 0, 33, 1, 45, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3,
33, 4, 44, 2, 44, 2, 33, 5, 44, 3, 33, 1, 45, 33, 1, 45, 33, 1, 45, 2, "print", 1, 35, 33, 1, 33, 2, 33, 3, 33, 4, 44,
2, 44, 2, 33, 5, 44, 3, 33, 1, 45, 33, 1, 45, 33, 1, 45, 2, "print", 1, 35, 33, 1, 33, 1, 33, 2, 33, 3, 33, 4, 44, 2,
44, 2, 33, 5, 44, 3, 33, 1, 45, 33, 1, 45, 33, 1, 45, 6, 2, "print", 1, 35, 35]
1 change: 1 addition & 0 deletions hogvm/__tests__/__snapshots__/tuples.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tuple()
tuple(1)
(1, 2)
(1, 2)
(1, 2, 3)
(1, '2', 3)
(1, (2, 3), 4)
Expand Down
10 changes: 5 additions & 5 deletions hogvm/__tests__/arrays.hog
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
print([])
print([1, 2, 3])
print([1, '2', 3])
print([1, '2', 3, ])
print([1, [2, 3], 4])
print([1, [2, [3, 4]], 5])

let a := [1, 2, 3]
print(a[1])
print([1, 2, 3][1])
print([1, [2, [3, 4]], 5][1][1][1])
print(a[1], )
print([1, 2, 3][1], )
print([1, [2, [3, 4], ], 5][1][1][1])
print([1, [2, [3, 4]], 5][1][1][1] + 1)
print([1, [2, [3, 4]], 5].1.1.1)
print([1, [2, [3, 4, ], ], 5, ].1.1.1)
4 changes: 2 additions & 2 deletions hogvm/__tests__/dicts.hog
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ print({key: 'value'})
let key := 3
print({key: 'value'})

print({'key': 'value'}.key)
print({'key': 'value', }.key)
print({'key': 'value'}['key'])
print({'key': {'otherKey': 'value'}}.key.otherKey)
print({'key': {'otherKey': 'value'}}['key'].otherKey)
print({'key': {'otherKey': 'value', } , }['key'].otherKey)
3 changes: 2 additions & 1 deletion hogvm/__tests__/tuples.hog
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
print(tuple())
print((1,))
print((1, 2))
print((1, 2,))
print((1, 2, 3))
print((1, '2', 3))
print((1, (2, 3), 4))
print((1, (2, (3, 4)), 5))
let a := (1, 2, 3)
print(a[1])
print((1, (2, (3, 4)), 5)[1][1][1])
print((1, (2, (3, 4)), 5).1.1.1)
print((1, (2, (3, 4, ), ), 5, ).1.1.1)
print((1, (2, (3, 4)), 5)[1][1][1] + 1)

0 comments on commit 8a96d2a

Please sign in to comment.