Commits

Matt McClure committed cb0d4f1

Update existing tests for new stack frame format.

The stack frame format for multi-frame stack navigation includes a frame
number for each frame.

  • Participants
  • Parent commits c45d571

Comments (0)

Files changed (1)

testing/test_pdb.py

         return a+b+c
 
     check(fn, """
+[NUM]
 > .*fn()
 -> a = 1
 # n
+[NUM]
 > .*fn()
 -> b = 2
 # n
+[NUM]
 > .*fn()
 -> c = 3
 # c
         nested()
 
     check(fn, """
+[NUM]
 > .*nested()
 -> return
 # up
+[NUM]
 > .*fn()
 -> nested()
 # xx
         return c
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return c
 # c
         return args
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return args
 # args
         return a
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return a
 # ll
 NUM             set_trace()
 NUM  ->         return a
 # c
-""".replace('NUM', ' *[0-9]*'))
+""")
 
 def test_display():
     def fn():
         return a
 
     check(fn, """
+[NUM]
 > .*fn()
 -> b = 1
 # display a
 # n
+[NUM]
 > .*fn()
 -> a = 2
 # n
+[NUM]
 > .*fn()
 -> a = 3
 a: 1 --> 2
 # undisplay a
 # n
+[NUM]
 > .*fn()
 -> return a
 # c
         return b
 
     check(fn, """
+[NUM]
 > .*fn()
 -> b = 42
 # display b
 # n
+[NUM]
 > .*fn()
 -> return b
 b: <undefined> --> 42
         return a
 
     check(fn, """
+[NUM]
 > .*fn()
 -> a = 1
 # sticky
 NUM             c = 3
 NUM             return a
 # n
+[NUM]
 > .*fn()
 -> b = 2
 CLEAR>.*
 NUM             return a
 # sticky
 # n
+[NUM]
 > .*fn()
 -> c = 3
 # c
     end = lineno + 3
 
     check(fn, """
+[NUM]
 > .*fn()
 -> a = 1
 # sticky %d %d
         return a
 
     check(fn, """
+[NUM]
 > .*fn()
 -> a = 1
 CLEAR>.*
             xpm()
 
     check(fn, """
+[NUM]
 > .*bar()
 -> assert False
 # u
+[NUM]
 > .*fn()
 -> bar()
 # ll
             pdb.post_mortem(Pdb=PdbTest)
 
     check(fn, """
+[NUM]
 > .*fn()
 -> 1/0
 # c
             xpm()
 
     check(fn, """
+[NUM]
 > .*gen()
 -> assert False
 # u
+[NUM]
 > .*fn()
 -> for i in gen():
 # c
     
     exec src.compile()
     check(fn, """
+[NUM]
 > .*fn()
 -> return x
 # ll
         return bar()
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return bar()
 # source bar
         return 42
 
     check(fn, r"""
+[NUM]
 > .*fn()
 -> return 42
 # source 42
         filename = filename[:-1]
     
     check(fn, r"""
+[NUM]
 > .*fn()
 -> return 42
 # edit
 """ % (return42_lineno, filename))
 
     check(bar, r"""
+[NUM]
 > .*fn()
 -> return 42
 # up
+[NUM]
 > .*bar()
 -> fn()
 # edit
         filename = filename[:-1]
 
     check(fn, r"""
+[NUM]
 > .*fn()
 -> return 42
 # edit bar
         filename = filename[:-1]
     #
     check(bar, """
+[NUM]
 > .*bar()
 -> return 42
 # edit bar
     start_lineno = lineno + 1
 
     check(fn, r"""
+[NUM]
 > .*fn()
 -> return 42
 # x = 10
     start_lineno = lineno + 1
 
     check(fn, r"""
+[NUM]
 > .*fn()
 -> if False: g()
 # g()
     start_lineno = lineno + 3
 
     check(fn, r"""
+[NUM]
 > .*fn()
 -> return x
 # x = 10
     start_lineno = lineno + 2
 
     check(fn, r"""
+[NUM]
 > .*fn()
 -> return 42
 # x
         return x
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return x
 # x
         return 1
 
     check(fn, """
+[NUM]
 > .*fn()
 -> g()
    1 frame hidden .*
 ... Newest frame
 # hf_unhide
 # down           # now the frame is no longer hidden
+[NUM]
 > .*g()
 -> return 'foo'
 # up
+[NUM]
 > .*fn()
 -> g()
 # hf_hide        # hide the frame again
         return 1
 
     check(fn, """
+[NUM]
 > .*fn()
 -> g()
    1 frame hidden .*
 # hf_unhide
-# down           # now the frame is no longer hidden
+# down
+[NUM]
 > .*g()
 -> return 'foo'
 # hf_hide        # hide the current frame, go to the top of the stack
+[NUM]
 > .*fn()
 -> g()
 # c
         k()
         return 1
     check(fn, """
+[NUM]
 > .*fn()
 -> k()
    2 frames hidden .*
         return 1
 
     check(fn, """
+[NUM]
 > .*fn()
 -> k()
    2 frames hidden .*
         return g()
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return g()
    1 frame hidden .*
         return 1
 
     check(fn, """
+[NUM]
 > .*fn()
 -> g()
-# c           # note that the hidden frame count is not displayed
+# c
 """)
 
 
         return 1
 
     check(fn, """
+[NUM]
 > .*g()
 -> return 'foo'
-# c           # note that we were inside g()
+# c
 """)
 
 
         return obj.x
 
     check(fn, """
+[NUM]
 > .*fn()
 -> obj.x = 0
    1 frame hidden .*
 # hasattr(obj, 'x')
 False
 # n
+[NUM]
 > .*fn()
 -> return obj.x
 # print obj.x
         return obj.x
 
     check(fn, """
+[NUM]
 > .*fn()
 -> obj.x = 42
    1 frame hidden .*
 # obj.x
 0
 # n
+[NUM]
 > .*fn()
 -> return obj.x
 # obj.x
         a.bar = 42
 
     check(fn, """
+[NUM]
 > .*fn()
 -> a.bar = 42
    1 frame hidden .*
         return obj.x
 
     check(fn, """
+[NUM]
 > .*fn()
 -> obj.x = 0
    1 frame hidden .*
 # hasattr(obj, 'x')
 False
 # n
+[NUM]
 > .*fn()
 -> return obj.x
 # print obj.x
         return 42
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return 42
 # track
         return 1
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return 1
 # debug g()
 ENTERING RECURSIVE DEBUGGER
+[NUM]
 > .*
 (#) s
 --Call--
+[NUM]
 > .*g()
 -> def g():
 (#) ll
         return 1
 
     check(fn, """
+[NUM]
 > .*fn()
 -> return 1
 HOOK!
         return
 
     check(fn, """
+[NUM]
 > .*fn()
 -> x = "this is plan ascii"
 # n
+[NUM]
 > .*fn()
 -> y = "this contains a unicode:"
 # c
     line_z = lineno+4
 
     check(fn, """
+[NUM]
 > .*fn()
 -> x = 1
 # c %d
 Breakpoint 1 at .*/test_pdb.py:%d
 Deleted breakpoint 1
+[NUM]
 > .*fn()
 -> z = 3
 # c