()
| 408 | // -- Global string constants --------------------------------------------------- |
| 409 | |
| 410 | #[test] |
| 411 | fn string_literal_creates_global_string() { |
| 412 | // String literals are byte slices. |
| 413 | let source = r#"type Text = u8[] |
| 414 | main: () -> i32 { |
| 415 | msg: Text = "hello" |
| 416 | return 0 |
| 417 | }"#; |
| 418 | let result = compile_ok(source); |
| 419 | assert!( |
| 420 | !result.ir_program.global_strings.is_empty(), |
| 421 | "expected at least one global string constant" |
| 422 | ); |
| 423 | } |
| 424 | |
| 425 | #[test] |
| 426 | fn string_literal_content_preserved() { |
nothing calls this directly
no test coverage detected