Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor annoyances with Amber tests #612

Merged
merged 4 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions src/tests/postprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,17 @@ use super::compile_code;

#[test]
fn default_ok() {
let default = PostProcessor::get_default();

let hello = "echo \"Hello world!\"";
let hello = compile_code(hello);

let mut unavailable = vec![];

for processor in &default {
if ! processor.is_available() {
unavailable.push(processor.name.clone());
let processors = PostProcessor::get_default();
for processor in processors {
if processor.is_available() {
let res = processor.execute(hello.clone());
assert!(res.is_ok(), "Postprocessor {} couldn't process hello world", processor.name);
let res = res.unwrap();
let (stdout, _) = eval_bash(res);
assert_eq!(stdout, "Hello world!");
}
}

assert!(unavailable.is_empty(), "These commands have to be in $PATH for this test to pass: {}", unavailable.join(", "));

for processor in default {
let res = processor.execute(hello.clone());
assert!(res.is_ok(), "Postprocessor {} couldn't process hello world", processor.name);
let res = res.unwrap();
let (stdout, _) = eval_bash(res);
assert_eq!(stdout, "Hello world!");
}
}
5 changes: 3 additions & 2 deletions src/tests/validity/import_existing_file.ab
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import * from "test_files/str/trim.ab"
echo trim(" Succeeded ")
import * from "src/tests/validity/test_files/str/trim.ab"

echo trim(" Succeeded ")
2 changes: 1 addition & 1 deletion src/tests/validity/import_existing_nested_file.ab
hdwalters marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * from "test_files/is_even.ab"
import * from "src/tests/validity/test_files/is_even.ab"

// Output
// even
Expand Down
3 changes: 3 additions & 0 deletions src/tests/validity/import_transitive_import.ab
hdwalters marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * from "src/tests/validity/test_files/is_even.ab"

echo trim(" Succeeded ")
2 changes: 0 additions & 2 deletions src/tests/validity/public_import.ab

This file was deleted.

File renamed without changes.
File renamed without changes.