From 904367736833aace24cdd778da64aeb363b52338 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 14 Apr 2021 19:26:07 -0600 Subject: add a test for export assignment --- src/makefile/input.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/makefile') diff --git a/src/makefile/input.rs b/src/makefile/input.rs index 5dda538..5a1259f 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -1177,4 +1177,21 @@ test: c ); Ok(()) } + + #[cfg(feature = "full")] + #[test] + fn export_assign() -> R { + let file = "export x = 3"; + let args = Args::empty(); + let makefile = MakefileReader::read(&args, MacroSet::new(), Cursor::new(file), "")?; + let makefile = makefile.finish(); + assert_eq!( + makefile.macros.get("x").map(|x| &x.text), + Some(&TokenString::text("3")) + ); + assert!( + matches!(makefile.macro_exports, ExportConfig::Only(exported) if exported.contains("x")) + ); + Ok(()) + } } -- cgit v1.2.3