Skip to content

Commit

Permalink
fix: bad test expectation
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroo committed Aug 5, 2023
1 parent ef8c025 commit 816a8b6
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions parser/src/cfg/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ fn test_include_bad2_has_original_filename() {
}

#[test]
fn parse_submacro() {
fn parse_bad_submacro() {
// Test exists since it used to crash. It should not crash.
let _lk = match CFG_PARSE_LOCK.lock() {
Ok(guard) => guard,
Err(poisoned) => poisoned.into_inner(),
Expand All @@ -565,7 +566,7 @@ fn parse_submacro() {
let source = r#"
(defsrc a)
(deflayer base
(macro M-S-())
(macro M-s-())
)
"#;
parse_cfg_raw_string(source, &mut s, "test")
Expand All @@ -576,6 +577,29 @@ fn parse_submacro() {
.unwrap_err();
}

#[test]
fn parse_bad_submacro_2() {
// Test exists since it used to crash. It should not crash.
let _lk = match CFG_PARSE_LOCK.lock() {
Ok(guard) => guard,
Err(poisoned) => poisoned.into_inner(),
};
let mut s = ParsedState::default();
let source = r#"
(defsrc a)
(deflayer base
(macro M-s-g)
)
"#;
parse_cfg_raw_string(source, &mut s, "test")
.map_err(|e| {
eprintln!("{:?}", error_with_source(e));
""
})
.unwrap_err();
}


#[test]
fn parse_switch() {
let _lk = match CFG_PARSE_LOCK.lock() {
Expand Down

0 comments on commit 816a8b6

Please sign in to comment.