mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 16:08:24 +00:00
test: add cast test
This commit is contained in:
parent
e7037cfd33
commit
f969f37b8c
|
@ -10,6 +10,7 @@ mod common;
|
||||||
#[test_case(include_str!("programs/factorial.ed"), "factorial", false, 24, &[] ; "factorial")]
|
#[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/refs.ed"), "refs", false, 2, &[] ; "refs")]
|
||||||
#[test_case(include_str!("programs/struct.ed"), "struct", false, 5, &[] ; "r#struct")]
|
#[test_case(include_str!("programs/struct.ed"), "struct", false, 5, &[] ; "r#struct")]
|
||||||
|
#[test_case(include_str!("programs/casts.ed"), "casts", false, 2, &[] ; "casts")]
|
||||||
#[test_case(TEST_ADD, "TEST_ADD", false, 2, &[] ; "TEST_ADD")]
|
#[test_case(TEST_ADD, "TEST_ADD", false, 2, &[] ; "TEST_ADD")]
|
||||||
#[test_case(TEST_SUB, "TEST_SUB", false, 1, &[] ; "TEST_SUB")]
|
#[test_case(TEST_SUB, "TEST_SUB", false, 1, &[] ; "TEST_SUB")]
|
||||||
#[test_case(TEST_MUL, "TEST_MUL", false, 4, &[] ; "TEST_MUL")]
|
#[test_case(TEST_MUL, "TEST_MUL", false, 4, &[] ; "TEST_MUL")]
|
||||||
|
|
8
lib/edlang_driver/tests/programs/casts.ed
Normal file
8
lib/edlang_driver/tests/programs/casts.ed
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
mod Main {
|
||||||
|
|
||||||
|
pub fn main(argc: i32, argv: *const *const u8) -> i64 {
|
||||||
|
let a: i32 = 2;
|
||||||
|
let b: i64 = a as i64;
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue