Skip to content

Commit

Permalink
Added supporting test, albeit not a great one.
Browse files Browse the repository at this point in the history
  • Loading branch information
quephird committed Mar 22, 2024
1 parent 3cd6662 commit 2e7ddca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sloxTests/InterpreterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,18 @@ quux.count
XCTAssertEqual(actual, expected)
}

func testInterpretAddingTwoLists() throws {
let input = """
var xyzzy = [1, 2, 3] + [4, 5, 6];
xyzzy.count
"""

let interpreter = Interpreter()
let actual = try interpreter.interpretRepl(source: input)
let expected: LoxValue = .number(6)
XCTAssertEqual(actual, expected)
}

func testInterpretExpressionWithListSubscriptingMethodInvocationAndPropertyGetting() throws {
let input = """
class Foo { }
Expand Down

0 comments on commit 2e7ddca

Please sign in to comment.