forked from igordejanovic/rustemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for igordejanovic#16, subtract overflow
- Loading branch information
Andrew Baxter
committed
Oct 15, 2024
1 parent
139c99d
commit 228d118
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ mod errors; | |
mod evaluate; | ||
mod forest; | ||
mod lexical_ambiguity; | ||
mod regressions; | ||
mod special; |
43 changes: 43 additions & 0 deletions
43
tests/src/glr/regressions/issue_16_subtract_overflow_panic/inline.rustemo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Inline: InlineEl*; | ||
InlineEl: prefix=StrongDelim children=Inline suffix=StrongDelim? {Strong, 11, left} | ||
| prefix=EmphasisDelim children=Inline suffix=EmphasisDelim? {Emphasis, 11, left} | ||
| title_prefix=LinkTitlePrefix title=Inline continuation=Link1? {Link , 11, left} | ||
| prefix=CodeDelim text=CodeChar* suffix=CodeDelim? {Code, 11, left} | ||
| text=TextChar+ {Text, 9, left}; | ||
|
||
StrongDelim: StrongT; | ||
|
||
EmphasisDelim: EmphasisT; | ||
|
||
LinkTitlePrefix: LinkTitlePrefixT; | ||
LinkTitleSuffix: LinkTitleSuffixT; | ||
LinkAddressPrefix: LinkAddressPrefixT; | ||
LinkAddressSuffix: LinkAddressSuffixT; | ||
Link1: title_suffix=LinkTitleSuffix address=LinkAddress?; | ||
LinkAddress: prefix=LinkAddressPrefix address=LinkAddressChar* suffix=LinkAddressSuffix?; | ||
LinkAddressChar: LinkAddressCharT | EscapedChar; | ||
|
||
CodeDelim: CodeDelimT; | ||
CodeChar: CodeCharT | EscapedChar; | ||
|
||
TextChar: TextCharT | EscapedChar; | ||
|
||
EscapeChar: EscapeT; | ||
EscapedChar: prefix=EscapeChar text=AnyCharT; | ||
|
||
Layout: Empty; | ||
|
||
terminals | ||
Empty: ""; | ||
EscapeT: "\\"; | ||
AnyCharT: /./; | ||
TextCharT: /[^*_`\\]/; | ||
CodeDelimT: "`"; | ||
CodeCharT: /[^`\\]/; | ||
LinkTitlePrefixT: "["; | ||
LinkTitleSuffixT: "]("; | ||
LinkAddressPrefixT: "("; | ||
LinkAddressSuffixT: ")"; | ||
LinkAddressCharT: /[^)\\]/; | ||
StrongT: "*"; | ||
EmphasisT: "_"; |
22 changes: 22 additions & 0 deletions
22
tests/src/glr/regressions/issue_16_subtract_overflow_panic/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use rustemo::{rustemo_mod, Parser}; | ||
|
||
rustemo_mod!( | ||
inline, | ||
"/src/glr/regressions/issue_16_subtract_overflow_panic" | ||
); | ||
rustemo_mod!( | ||
inline_actions, | ||
"/src/glr/regressions/issue_16_subtract_overflow_panic" | ||
); | ||
|
||
use self::inline::{DefaultBuilder, InlineParser}; | ||
|
||
#[test] | ||
fn subtract_overflow() { | ||
InlineParser::new() | ||
.parse("*ld 2") | ||
.unwrap() | ||
.get_first_tree() | ||
.unwrap() | ||
.build(&mut DefaultBuilder::new()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod issue_16_subtract_overflow_panic; |