MCPcopy Create free account
hub / github.com/Shopify/shadowenv / test_source_ordering

Function test_source_ordering

src/lang.rs:443–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 2

build_sourceFunction · 0.85
build_shadow_envFunction · 0.70

Tested by

no test coverage detected