Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xffxff committed Sep 20, 2023
1 parent 24f3867 commit f18b96f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ impl TestCase {
if lox.extension().unwrap_or_default() != "lox" {
panic!("expected lox file, got {}", lox.display());
}
let token = lox.with_extension("token");
let syntax = lox.with_extension("syntax");
let bytecode = lox.with_extension("bytecode");
let execute = lox.with_extension("execute");

// if the lox file is `foo/bar.lox`, then the generated files will be
// `foo/bar/{token,syntax,bytecode,execute}`
let parent = lox.parent().unwrap();
let lox_dir = parent.join(lox.file_stem().unwrap());
let token = lox_dir.join("token");
let syntax = lox_dir.join("syntax");
let bytecode = lox_dir.join("bytecode");
let execute = lox_dir.join("execute");
let text = fs::read_to_string(&lox).unwrap();
TestCase {
lox: lox.to_owned(),
Expand Down

0 comments on commit f18b96f

Please sign in to comment.