summaryrefslogtreecommitdiffstats
path: root/vendor/pest_derive/tests/grammar.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/pest_derive/tests/grammar.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/pest_derive/tests/grammar.rs b/vendor/pest_derive/tests/grammar.rs
index 799beb7e0..57bed9072 100644
--- a/vendor/pest_derive/tests/grammar.rs
+++ b/vendor/pest_derive/tests/grammar.rs
@@ -6,6 +6,9 @@
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.
+#![cfg_attr(not(feature = "std"), no_std)]
+extern crate alloc;
+use alloc::{format, vec::Vec};
#[macro_use]
extern crate pest;
@@ -246,6 +249,20 @@ fn choice_range() {
}
#[test]
+fn choice_prefix() {
+ parses_to! {
+ parser: GrammarParser,
+ input: "abc",
+ rule: Rule::choice_prefix,
+ tokens: [
+ choice_prefix(0, 3, [
+ string(0, 3)
+ ])
+ ]
+ };
+}
+
+#[test]
fn optional_string() {
parses_to! {
parser: GrammarParser,
@@ -783,6 +800,20 @@ fn repeat_mutate_stack() {
}
#[test]
+fn stack_resume_after_fail() {
+ parses_to! {
+ parser: GrammarParser,
+ input: "a,b,c,cba",
+ rule: Rule::stack_resume_after_fail,
+ tokens: [
+ stack_resume_after_fail(0, 9, [
+ repeat_mutate_stack_pop_all(0, 9)
+ ])
+ ]
+ };
+}
+
+#[test]
fn checkpoint_restore() {
parses_to! {
parser: GrammarParser,