Skip to content

Commit

Permalink
feat: use .brain as file extension (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Feb 20, 2022
1 parent d2322db commit c2a7949
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -28,7 +28,7 @@ $ cargo install brainease
<br />

```r
# brainease -f examples/hello.bz
# brainease -f examples/hello.brain

save 'H' at *1
save 'e' at *2
Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions tests/integration_tests.rs
Expand Up @@ -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());

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c2a7949

Please sign in to comment.