tests: rework util.debugstacktrace tests
authorMads Kiilerich <madski@unity3d.com>
Fri, 16 Jan 2015 04:26:40 +0100
changeset 31313 80752c655320
parent 31312 7eb53603744b
child 31314 7c877cbf30d6
tests: rework util.debugstacktrace tests Prepare for adding another test.
tests/test-debugcommands.t
--- a/tests/test-debugcommands.t	Sat Mar 11 11:04:14 2017 -0800
+++ b/tests/test-debugcommands.t	Fri Jan 16 04:26:40 2015 +0100
@@ -116,18 +116,25 @@
   $ cat > debugstacktrace.py << EOF
   > from mercurial.util import debugstacktrace, dst, sys
   > def f():
-  >     dst('hello world')
+  >     debugstacktrace(f=sys.stdout)
+  >     g()
   > def g():
-  >     f()
-  >     debugstacktrace(skip=-5, f=sys.stdout)
-  > g()
+  >     dst('hello from g\\n', skip=1)
+  >     h()
+  > def h():
+  >     dst('hi ...\\nfrom h hidden in g', 1)
+  > f()
   > EOF
   $ python debugstacktrace.py
-  hello world at:
-   debugstacktrace.py:7 in * (glob)
-   debugstacktrace.py:5 in g
-   debugstacktrace.py:3 in f
   stacktrace at:
-   debugstacktrace.py:7 *in * (glob)
-   debugstacktrace.py:6 *in g (glob)
-   */util.py:* in debugstacktrace (glob)
+   debugstacktrace.py:10 in * (glob)
+   debugstacktrace.py:3  in f
+  hello from g
+   at:
+   debugstacktrace.py:10 in * (glob)
+   debugstacktrace.py:4  in f
+  hi ...
+  from h hidden in g at:
+   debugstacktrace.py:10 in * (glob)
+   debugstacktrace.py:4  in f
+   debugstacktrace.py:7  in g