()
| 441 | |
| 442 | #[test] |
| 443 | fn test_source_ordering() { |
| 444 | let shadowenv = build_shadow_env(vec![]); |
| 445 | |
| 446 | let outer_source = build_source( |
| 447 | r#" |
| 448 | (env/set "TEST" "ONE") |
| 449 | "#, |
| 450 | ); |
| 451 | let inner_source = build_source( |
| 452 | r#" |
| 453 | (env/set "TEST" "TWO") |
| 454 | "#, |
| 455 | ); |
| 456 | |
| 457 | // Outer source comes first, as shown in test load_trusted_sources_returns_nearest_sources_last |
| 458 | // The source that comes last in the input list should be executed last |
| 459 | let shadowenv = ShadowLang::run_programs( |
| 460 | shadowenv, |
| 461 | SourceList::new_with_sources(vec![outer_source, inner_source]), |
| 462 | ) |
| 463 | .unwrap(); |
| 464 | assert_eq!(shadowenv.get("TEST"), Some("TWO".to_string())); |
| 465 | } |
| 466 | } |
nothing calls this directly
no test coverage detected