Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kubouch committed Sep 29, 2024
1 parent 6a27b87 commit a4265b9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
source: src/test.rs
expression: evaluate_example(path)
input_file: tests/binary_ops_spaces.nu
---
==== COMPILER ====
0: Int (0 to 1)
1: Plus (2 to 3)
2: Int (4 to 5)
3: BinaryOp { lhs: NodeId(0), op: NodeId(1), rhs: NodeId(2) } (0 to 5)
4: Int (6 to 7)
5: Plus (7 to 8)
6: Int (9 to 10)
7: BinaryOp { lhs: NodeId(4), op: NodeId(5), rhs: NodeId(6) } (6 to 10)
8: Int (11 to 12)
9: Plus (13 to 14)
10: Int (14 to 15)
11: BinaryOp { lhs: NodeId(8), op: NodeId(9), rhs: NodeId(10) } (11 to 15)
12: Int (16 to 17)
13: Plus (17 to 18)
14: Int (18 to 19)
15: BinaryOp { lhs: NodeId(12), op: NodeId(13), rhs: NodeId(14) } (16 to 19)
16: Block(BlockId(0)) (0 to 20)
==== COMPILER ERRORS ====
Error (NodeId 5): missing space before operator
Error (NodeId 9): missing space after operator
Error (NodeId 13): missing space before operator
Error (NodeId 13): missing space after operator
4 changes: 4 additions & 0 deletions tests/binary_ops_spaces.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 + 2
1+ 2
1 +2
1+2

0 comments on commit a4265b9

Please sign in to comment.