()
| 487 | ); |
| 488 | } |
| 489 | |
| 490 | #[test] |
| 491 | fn slice_element_write() { |
| 492 | // Writing through a slice element place mutates the backing array. 5 + 20 = 25. |
| 493 | assert_exit( |
| 494 | r#" |
| 495 | main: () -> i32 { |
| 496 | arr: i32[3] = [10, 20, 30] |
| 497 | view: i32[] = arr |
| 498 | view[0] = 5 |
| 499 | return view[0] + arr[1] |
| 500 | } |
| 501 | "#, |
| 502 | 25, |
| 503 | ); |
| 504 | } |
| 505 |
nothing calls this directly
no test coverage detected