Patchwork [1,of,4,accept-scripts] land: add test demonstrating JSON error on empty revset

login
register
mail settings
Submitter Kevin Bullock
Date May 2, 2018, 8:31 p.m.
Message ID <138a6f224f8529ecdc69.1525293109@ingalls.local>
Download mbox | patch
Permalink /patch/31251/
State New
Headers show

Comments

Kevin Bullock - May 2, 2018, 8:31 p.m.
# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1525291788 18000
#      Wed May 02 15:09:48 2018 -0500
# Node ID 138a6f224f8529ecdc69daac026684ee0892eb5e
# Parent  214aea0ce91528a7b22ba34ab991c43963872d23
land: add test demonstrating JSON error on empty revset

Patch

diff --git a/tests/test-land.t b/tests/test-land.t
--- a/tests/test-land.t
+++ b/tests/test-land.t
@@ -1,4 +1,21 @@ 
   $ . "$TESTDIR/lib.sh"
+BUG: Fails with no accepted nodes to land.
+  $ land
+  hg: parse error: empty query
+  Traceback (most recent call last):
+    File "/Users/kbullock/Source/Projects/hg/accept/tests/../land", line 57, in <module>
+      conf.source, _thesenodesrevset(all_accepted))))
+    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
+      **kw)
+    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
+      return _default_decoder.decode(s)
+    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
+      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
+    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
+      raise ValueError("No JSON object could be decoded")
+  ValueError: No JSON object could be decoded
+  [1]
+
 If only r2 is accepted, nothing happens.
   $ echo `hg log -r 2 -R source --template '{node}'` > bob-accepted
   $ land