Skip to content

Commit

Permalink
Test example rune scripts on CI
Browse files Browse the repository at this point in the history
Fixes some of the scripts along the way.
The one `_error.rn` file was moved to a new directory `compile-fail` to
indicate that the failure is expected.
  • Loading branch information
killercup committed Sep 12, 2020
1 parent 23258e4 commit 9aba683
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Expand Up @@ -21,4 +21,7 @@ jobs:
~/.cargo/bin
target
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}
- run: cargo test --all
- name: Run tests
run: cargo test --all
- name: Execute example scripts
run: cargo run --bin rune --release -- --experimental -O macros=true scripts/*.rn
Expand Up @@ -8,4 +8,3 @@ fn main() {
doit a
};
}

2 changes: 1 addition & 1 deletion scripts/fib.rn
Expand Up @@ -7,5 +7,5 @@ fn fib(n) {
}

fn main() {
fib(30)
fib(15)
}
2 changes: 1 addition & 1 deletion scripts/folding.rn
Expand Up @@ -5,5 +5,5 @@ fn main() {
"hello world";
'a';
[42, 42];
{"foo": 42, "bar": [1, 2, 3, 4]};
#{"foo": 42, "bar": [1, 2, 3, 4]};
}
2 changes: 1 addition & 1 deletion scripts/objects.rn
Expand Up @@ -3,6 +3,6 @@ fn main() {
object["bar"] = object["foo"] + 1;
object = #{"foo": 1};
let object = #{"bar": 2};
let a = object["foo"];
let a = object.get("foo");
object
}
2 changes: 1 addition & 1 deletion scripts/strings.rn
Expand Up @@ -3,7 +3,7 @@ use string;
fn main() {
let a = "foo";

let s = string::with_capacity(42);
let s = String::with_capacity(42);
s.push_str(a);
s.push('/');
s.push_str("bar");
Expand Down

0 comments on commit 9aba683

Please sign in to comment.