test choice/sequence preference

This commit is contained in:
Arpad Ryszka 2017-11-26 00:52:08 +01:00
parent 062ad5b046
commit 0837802209

View File

@ -710,3 +710,26 @@ func TestPartialRead(t *testing.T) {
}}, }},
) )
} }
func TestChoiceSequencePriority(t *testing.T) {
runTests(
t,
`A = "a" | "b" "c"`,
[]testItem{{
title: "ac",
text: "ac",
fail: true,
}},
)
runTests(
t,
`A = "a" | "b" "c"`,
[]testItem{{
title: "bc",
text: "bc",
ignorePosition: true,
node: &Node{Name: "A"},
}},
)
}