diff tests/test-revset.t @ 25024:263bbed1833c

revset: test current behavior of addset class The addset class isn't simple and it has a hidden bug that will be fixed by future patches. So let's test the current behavior.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 30 Mar 2015 19:51:40 +0900
parents 6b54f749659b
children bb2f543b48b5
line wrap: on
line diff
--- a/tests/test-revset.t	Mon Apr 27 23:03:20 2015 +0900
+++ b/tests/test-revset.t	Mon Mar 30 19:51:40 2015 +0900
@@ -833,6 +833,54 @@
   4
   5
 
+test that `or` operation skips duplicated revisions from right-hand side
+
+  $ try 'reverse(1::5) or ancestors(4)'
+  (or
+    (func
+      ('symbol', 'reverse')
+      (dagrange
+        ('symbol', '1')
+        ('symbol', '5')))
+    (func
+      ('symbol', 'ancestors')
+      ('symbol', '4')))
+  * set:
+  <addset
+    <baseset [5, 3, 1]>,
+    <filteredset
+      <filteredset
+        <fullreposet+ 0:9>>>>
+  5
+  3
+  1
+  0
+  2
+  4
+  $ try 'sort(ancestors(4) or reverse(1::5))'
+  (func
+    ('symbol', 'sort')
+    (or
+      (func
+        ('symbol', 'ancestors')
+        ('symbol', '4'))
+      (func
+        ('symbol', 'reverse')
+        (dagrange
+          ('symbol', '1')
+          ('symbol', '5')))))
+  * set:
+  <addset+
+    <generatorset+>,
+    <filteredset
+      <baseset [5, 3, 1]>>>
+  0
+  1
+  2
+  3
+  4
+  5
+
 check that conversion to only works
   $ try --optimize '::3 - ::1'
   (minus