Skip to content

Commit

Permalink
test: add another unit test for parse_help
Browse files Browse the repository at this point in the history
  • Loading branch information
Mcdostone committed Feb 7, 2025
1 parent fdaff06 commit 7fa13e2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/attribute/help_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,27 @@ fn test_parse_help_double_newline() {
Ok(("", "bla 1\n bla 2\n\nbla 3".to_string()))
)

Check warning on line 123 in src/attribute/help_test.rs

View workflow job for this annotation

GitHub Actions / Format

Diff in /home/runner/work/nom-kconfig/nom-kconfig/src/attribute/help_test.rs
}


// https://github.com/Mcdostone/nom-kconfig/issues/65
// https://github.com/torvalds/linux/blob/92514ef226f511f2ca1fb1b8752966097518edc0/security/Kconfig#L236-L252
#[test]
fn test_parse_help_paragraph() {
let input = r#"help
This choice is there only for converting CONFIG_DEFAULT_SECURITY
in old kernel configs to CONFIG_LSM in new kernel configs. Don't
change this choice unless you are creating a fresh kernel config,
for this choice will be ignored after CONFIG_LSM has been set.
Selects the legacy "major security module" that will be
initialized first. Overridden by non-default CONFIG_LSM."#;
assert_parsing_eq!(
parse_help,
input,
Ok(("", "This choice is there only for converting CONFIG_DEFAULT_SECURITY\nin old kernel configs to CONFIG_LSM in new kernel configs. Don't\nchange this choice unless you are creating a fresh kernel config,\nfor this choice will be ignored after CONFIG_LSM has been set.\n\nSelects the legacy \"major security module\" that will be\ninitialized first. Overridden by non-default CONFIG_LSM.".to_string()))

Check warning on line 142 in src/attribute/help_test.rs

View workflow job for this annotation

GitHub Actions / Format

Diff in /home/runner/work/nom-kconfig/nom-kconfig/src/attribute/help_test.rs
)
}




0 comments on commit 7fa13e2

Please sign in to comment.