Skip to content

Commit 47079d4

Browse files
committed
Add test to clarify underscores in sections headers aren't allowed (#404)
1 parent 9d52164 commit 47079d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git-config/tests/parser/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ fn newline_events_are_merged() {
210210

211211
#[test]
212212
fn error() {
213+
let input = "[a_b]\n c=d";
214+
assert_eq!(
215+
parse_from_str(input).unwrap_err().to_string(),
216+
"Got an unexpected token on line 1 while trying to parse a section header: '[a_b]\n c=d'",
217+
"underscores in section names aren't allowed and will be rejected by git"
218+
);
213219
let input = "[core] a=b\n 4a=3";
214220
assert_eq!(
215221
parse_from_str(input).unwrap_err().to_string(),

0 commit comments

Comments
 (0)