summary refs log tree commit diff stats
path: root/tests/common
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-02-11 00:52:25 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-02-11 00:52:25 -0300
commitabaee464936a821568c3fdbd52b9aadd3adb6d0f (patch)
tree8a8b5c271f0b8b67eeb77e94a68ecf73ffc4e1f9 /tests/common
parent69652efe8ad9738a94fef571c8b81e342f96e7b4 (diff)
Partially implement VM
The following are now implemented:

- [x] Arrow
- [x] StringKey
- [x] RegexKey
- [ ] KeySubtree
- [ ] ValueSubtree
- [x] Ident
- [ ] Param
- [x] ApplyPredicate
- [x] End
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 9680504..d0b9e89 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -176,4 +176,14 @@ impl PatternTypes for Value {
     ) -> bool {
         left == right
     }
+
+    fn as_str<'b>(
+        item: RefOwn<'b, Self, Dummy>
+    ) -> Option<&'b str> {
+        match item {
+            RefOwn::Str(key) => Some(key),
+            RefOwn::Ref(Value::S(key)) => Some(key),
+            _ => None,
+        }
+    }
 }