[PATCH 1 of 3] tests: rework util.debugstacktrace tests
Mads Kiilerich
mads at kiilerich.com
Sat Mar 11 22:31:11 UTC 2017
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1421378800 -3600
# Fri Jan 16 04:26:40 2015 +0100
# Node ID 56ee8fd0a885a7ba4f4da5dbe85d8844bb45df5b
# Parent 295625f1296bda9c507b9025177c4f2452408cc3
tests: rework util.debugstacktrace tests
Prepare for adding another test.
diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t
--- a/tests/test-debugcommands.t
+++ b/tests/test-debugcommands.t
@@ -116,18 +116,25 @@ Test internal debugstacktrace command
$ 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
More information about the Mercurial-devel
mailing list