Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Feb 18, 2024
1 parent ccc70b9 commit 314750a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/edlang_driver/tests/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod common;
#[test_case(include_str!("programs/while.ed"), "while", false, 10, &[] ; "r#while")]
#[test_case(include_str!("programs/factorial.ed"), "factorial", false, 24, &[] ; "factorial")]
#[test_case(include_str!("programs/refs.ed"), "refs", false, 2, &[] ; "refs")]
#[test_case(include_str!("programs/struct.ed"), "struct", false, 5, &[] ; "r#struct")]
#[test_case(TEST_ADD, "TEST_ADD", false, 2, &[] ; "TEST_ADD")]
#[test_case(TEST_SUB, "TEST_SUB", false, 1, &[] ; "TEST_SUB")]
#[test_case(TEST_MUL, "TEST_MUL", false, 4, &[] ; "TEST_MUL")]
Expand Down
20 changes: 20 additions & 0 deletions lib/edlang_driver/tests/programs/struct.ed
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mod Main {

struct Hello {
a: i32,
b: i64,
}

pub fn main() -> i64 {
let x: Hello = Hello {
a: 2,
b: 3,
};
hello(&mut x);
return x.b;
}

pub fn hello(a: &mut Hello) {
a.b = 5;
}
}
20 changes: 20 additions & 0 deletions programs/struct.ed
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mod Main {

struct Hello {
a: i32,
b: i64,
}

pub fn main() -> i64 {
let x: Hello = Hello {
a: 2,
b: 3,
};
hello(&mut x);
return x.b;
}

pub fn hello(a: &mut Hello) {
a.b = 5;
}
}
1 change: 0 additions & 1 deletion what

This file was deleted.

0 comments on commit 314750a

Please sign in to comment.