Patchwork [1,of,3,V2] test-debugextensions: add dummy extension to make ifcontains() test more solid

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 31, 2016, 3:13 p.m.
Message ID <38bc0d42369725474c4f.1472656427@mimosa>
Download mbox | patch
Permalink /patch/16513/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 31, 2016, 3:13 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1472654197 -32400
#      Wed Aug 31 23:36:37 2016 +0900
# Node ID 38bc0d42369725474c4f25df15947546c1f13e2a
# Parent  6d66200bff3bf14a996c2908d691b96ab6b14f02
test-debugextensions: add dummy extension to make ifcontains() test more solid

If testedwith were a string, ifcontains("3.2", testedwith) would match "3.2.1".
New test added to cover that.

Patch

diff --git a/tests/test-debugextensions.t b/tests/test-debugextensions.t
--- a/tests/test-debugextensions.t
+++ b/tests/test-debugextensions.t
@@ -4,6 +4,10 @@ 
 
   $ cat > extwithoutinfos.py <<EOF
   > EOF
+  $ cat > extwithinfos.py <<EOF
+  > testedwith = '3.0 3.1 3.2.1'
+  > buglink = 'https://example.org/bts'
+  > EOF
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
@@ -13,11 +17,13 @@ 
   > rebase=
   > mq=
   > ext1 = $debugpath
+  > ext2 = `pwd`/extwithinfos.py
   > EOF
 
   $ hg debugextensions
   color
   ext1 (untested!)
+  ext2 (3.2.1!)
   histedit
   mq
   patchbomb
@@ -29,6 +35,10 @@ 
     tested with: internal
   ext1
     location: */extwithoutinfos.py* (glob)
+  ext2
+    location: */extwithinfos.py* (glob)
+    tested with: 3.0 3.1 3.2.1
+    bug reporting: https://example.org/bts
   histedit
     location: */hgext/histedit.py* (glob)
     tested with: internal
@@ -57,6 +67,12 @@ 
     "testedwith": []
    },
    {
+    "buglink": "https://example.org/bts",
+    "name": "ext2",
+    "source": "*/extwithinfos.py*", (glob)
+    "testedwith": ["3.0", "3.1", "3.2.1"]
+   },
+   {
     "buglink": "",
     "name": "histedit",
     "source": "*/hgext/histedit.py*", (glob)
@@ -82,5 +98,7 @@ 
    }
   ]
 
-  $ hg debugextensions -T '{ifcontains("internal", testedwith, "", "{name}\n")}'
-  ext1
+  $ hg debugextensions -T '{ifcontains("3.1", testedwith, "{name}\n")}'
+  ext2
+  $ hg debugextensions \
+  > -T '{ifcontains("3.2", testedwith, "no substring match: {name}\n")}'