diff --git a/README.md b/README.md index e2fe808..07487a2 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ $ cargo install brainease
```r -# brainease -f examples/hello.bz +# brainease -f examples/hello.brain save 'H' at *1 save 'e' at *2 diff --git a/src/main.rs b/src/main.rs index df96eb3..b002415 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,11 @@ fn main() { log::trace!("Cli args: {:?}", args); + if !args.main.ends_with(".brain") { + log::error!("{} does not end with .brain", args.main); + process::exit(1); + } + let (absolute_path, filename) = util::normalize_path(&args.main); log::trace!("Reading '{}'", filename); diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 4eecf7e..d17cd99 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -79,6 +79,10 @@ fn run_resources() -> Result<()> { let files = scan_dir(&Path::new("tests/resources").to_path_buf())?; for (filename, content) in files { + if !filename.ends_with(".brain") { + continue; + } + let instructions = parser::parse_file(&content); let io_handler = TestIoHandler::build_from_file(content.lines().collect()); diff --git a/tests/resources/goto-directions.bz b/tests/resources/goto-directions.brain similarity index 100% rename from tests/resources/goto-directions.bz rename to tests/resources/goto-directions.brain diff --git a/tests/resources/hello.bz b/tests/resources/hello.brain similarity index 100% rename from tests/resources/hello.bz rename to tests/resources/hello.brain diff --git a/tests/resources/if-simple-test.bz b/tests/resources/if-simple-test.brain similarity index 100% rename from tests/resources/if-simple-test.bz rename to tests/resources/if-simple-test.brain diff --git a/tests/resources/loop.bz b/tests/resources/loop.brain similarity index 100% rename from tests/resources/loop.bz rename to tests/resources/loop.brain