tests/test-fileset.t
changeset 38864 73731fa8d1bd
parent 38832 ca4de8ba5b5f
child 38865 899b4c74209c
--- a/tests/test-fileset.t	Sat Aug 04 17:08:33 2018 +0900
+++ b/tests/test-fileset.t	Sat Jul 21 17:13:34 2018 +0900
@@ -203,6 +203,30 @@
   b1
   b2
 
+OR expression should be reordered by weight:
+
+  $ fileset -p optimized -s -r. 'grep("a") or a1 or grep("b") or b2'
+  * optimized:
+  (or
+    (symbol 'a1')
+    (symbol 'b2')
+    (func
+      (symbol 'grep')
+      (string 'a'))
+    (func
+      (symbol 'grep')
+      (string 'b')))
+  * matcher:
+  <unionmatcher matchers=[
+    <patternmatcher patterns='(?:a1$)'>,
+    <patternmatcher patterns='(?:b2$)'>,
+    <predicatenmatcher pred=grep('a')>,
+    <predicatenmatcher pred=grep('b')>]>
+  a1
+  a2
+  b1
+  b2
+
 Use differencematcher for 'x and not y':
 
   $ fileset -p optimized -s 'a* and not a1'