restructure syntax

This commit is contained in:
nora 2022-04-26 20:13:34 +02:00
parent c916611bdc
commit 266eeb7327
96 changed files with 624 additions and 151 deletions

View file

@ -1,6 +1,7 @@
#[macro_export]
macro_rules! run_test {
($name:ident, $code:expr) => {
($(#[$attr:tt])* $name:ident, $code:expr) => {
$(#[$attr])*
#[test]
fn $name() {
let code = $code;

View file

@ -43,6 +43,7 @@ print "correct3";
);
run_test!(
#[ignore]
parameters,
r#"
fn fancy_print(str) {
@ -54,6 +55,7 @@ fancy_print("correct");
);
run_test!(
#[ignore]
parameters_and_return,
r#"
fn add(a, b) {
@ -71,6 +73,7 @@ if added == 6 {
);
run_test!(
#[ignore]
fib5,
r#"
fn fib(n) {