in reply to Re: Get the number of the current test when debugging a test script
in thread Get the number of the current test when debugging a test script

Yes, but I don't "know" which line to put it on. I don't want to have to trawl through the code manually counting my tests to find which one the test fails after.

I was disappointed to find that you can't have a conditional watch, actually (e.g. watch for when $var == 3).

Update

removed misconception thanks to RonW

To watch for a variable reaching a certain value, you need

w (3 == var)

or just

w var == 3

Replies are listed 'Best First'.
Re^3: Get the number of the current test when debugging a test script
by RonW (Parson) on Jun 30, 2015 at 19:18 UTC

    Based on the description in "perdebug":

    w expr

    Add a global watch-expression. Whenever a watched global changes the debugger will stop and display the old and new values.

    I would expect w (3 == $var) to do what you are asking for.

      Aha! Thanks RonW, I didn't quite get that. I just need the expr to return true. Spot on.