test: add cast test

This commit is contained in:
Edgar 2024-03-02 10:22:29 +01:00
parent e7037cfd33
commit f969f37b8c
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387
2 changed files with 9 additions and 0 deletions

View file

@ -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")]

View 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;
}
}