Skip to content

Commit

Permalink
correct broken test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
wcho21 committed Jan 31, 2024
1 parent 5a054e7 commit e72781d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ it("execute 1 == 2", () => {
expect(execute("1 == 2")).toBe("거짓");
});

it("execute 2 > 1 == 참", () => {
expect(execute("2 > 1 == 참")).toBe("참");
it("execute 참 == 2 > 1", () => {
expect(execute("참 == 2 > 1")).toBe("참");
});

it("execute 1 != 1 == 거짓", () => { // note that comparison is left associative
expect(execute("1 != 1 == 거짓")).toBe("참");
it("execute 거짓 == 1 != 1", () => { // note that comparison is left associative
expect(execute("거짓 == 1 != 1")).toBe("참");
});

it("execute 거짓 == (1 < 1+1)", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Lexer from "./lexer";
import Parser from "./parser";
import Evaluator, { Environment } from "./evaluator";
import Parser from "./parser/v2";
import Evaluator, { Environment } from "./evaluator/v2";

export const execute = (input: string): string => {
const lexer = new Lexer(input);
const parser = new Parser(lexer);
const parsed = parser.parseProgram();
const parsed = parser.parseSource();

const evaluator = new Evaluator();
const environment = new Environment();
Expand Down

0 comments on commit e72781d

Please sign in to comment.