diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-14 19:26:07 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-14 19:26:07 -0600 |
commit | 904367736833aace24cdd778da64aeb363b52338 (patch) | |
tree | 3b928acac92de69d41fe6887ef53b116c677c801 | |
parent | eb61a461411d54b08562ce04878ace57836f2a61 (diff) | |
download | makers-904367736833aace24cdd778da64aeb363b52338.tar.gz makers-904367736833aace24cdd778da64aeb363b52338.zip |
add a test for export assignment
-rw-r--r-- | src/makefile/input.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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(()) + } } |