diff options
Diffstat (limited to 'tests/functional/repl_characterization/data')
8 files changed, 100 insertions, 31 deletions
diff --git a/tests/functional/repl_characterization/data/basic.ast b/tests/functional/repl_characterization/data/basic.ast index bdb445c9a..e079af588 100644 --- a/tests/functional/repl_characterization/data/basic.ast +++ b/tests/functional/repl_characterization/data/basic.ast @@ -1,16 +1,27 @@ -Commentary "meow meow meow" -Command "command" -Output "output output one" -Output "" -Output "" -Output "output output two" -Commentary "meow meow" -Command "command two" -Output "output output output" -Commentary "commentary" -Output "output output output" -Output "" -Commentary "the blank below should be chomped" -Command "command three" -Commentary "" -Output "meow output" +Commentary: "meow meow meow" +Indent: " " +Prompt: "nix-repl> " +Command: "command" +Indent: " " +Output: "output output one" +Output: "" +Commentary: "" +Indent: " " +Output: "output output two" +Commentary: "meow meow" +Indent: " " +Prompt: "nix-repl> " +Command: "command two" +Indent: " " +Output: "output output output" +Commentary: "commentary" +Indent: " " +Output: "output output output" +Output: "" +Commentary: "the blank below should be chomped" +Indent: " " +Prompt: "nix-repl> " +Command: "command three" +Commentary: "" +Indent: " " +Output: "meow output" diff --git a/tests/functional/repl_characterization/data/basic_tidied.ast b/tests/functional/repl_characterization/data/basic_tidied.ast index 878065a5c..d41d21a96 100644 --- a/tests/functional/repl_characterization/data/basic_tidied.ast +++ b/tests/functional/repl_characterization/data/basic_tidied.ast @@ -1,10 +1,9 @@ -Command "command" -Output "output output one" -Output "" -Output "" -Output "output output two" -Command "command two" -Output "output output output" -Output "output output output" -Command "command three" -Output "meow output" +Command: "command" +Output: "output output one" +Output: "" +Output: "output output two" +Command: "command two" +Output: "output output output" +Output: "output output output" +Command: "command three" +Output: "meow output" diff --git a/tests/functional/repl_characterization/data/basic_tidied.test b/tests/functional/repl_characterization/data/basic_tidied.test new file mode 100644 index 000000000..2c56c489b --- /dev/null +++ b/tests/functional/repl_characterization/data/basic_tidied.test @@ -0,0 +1,10 @@ +command +output output one + +output output two +command two +output output output +output output output + +command three +meow output diff --git a/tests/functional/repl_characterization/data/no_nested_debuggers.test b/tests/functional/repl_characterization/data/no_nested_debuggers.test index 5e834a68a..0199407f6 100644 --- a/tests/functional/repl_characterization/data/no_nested_debuggers.test +++ b/tests/functional/repl_characterization/data/no_nested_debuggers.test @@ -1,3 +1,4 @@ +@args --debugger we enter a debugger via builtins.break in the input file. info: breakpoint reached @@ -37,3 +38,4 @@ and once again, more breakpoints are ignored. nix-repl> builtins.break 3 3 + error: bar diff --git a/tests/functional/repl_characterization/data/regression_9917.test b/tests/functional/repl_characterization/data/regression_9917.test index 44ca951b5..67ad1db6b 100644 --- a/tests/functional/repl_characterization/data/regression_9917.test +++ b/tests/functional/repl_characterization/data/regression_9917.test @@ -1,6 +1,7 @@ https://github.com/NixOS/nix/pull/9917 (Enter debugger more reliably in let expressions and function calls) This test ensures that continues don't skip opportunities to enter the debugger. +@args --debugger trace: before outer break info: breakpoint reached @@ -13,7 +14,7 @@ This test ensures that continues don't skip opportunities to enter the debugger. 0: error: breakpoint reached «none»:0 1: while calling a function - TEST_DATA/regression_9917.nix:3:5 + $TEST_DATA/regression_9917.nix:3:5 2| a = builtins.trace "before inner break" ( 3| builtins.break { msg = "hello"; } @@ -21,7 +22,7 @@ This test ensures that continues don't skip opportunities to enter the debugger. 4| ); 2: while calling a function - TEST_DATA/regression_9917.nix:2:7 + $TEST_DATA/regression_9917.nix:2:7 1| let 2| a = builtins.trace "before inner break" ( diff --git a/tests/functional/repl_characterization/data/regression_9918.test b/tests/functional/repl_characterization/data/regression_9918.test index c30c405b6..a85d6d33a 100644 --- a/tests/functional/repl_characterization/data/regression_9918.test +++ b/tests/functional/repl_characterization/data/regression_9918.test @@ -1,3 +1,4 @@ +@args --debugger error: … while evaluating the error message passed to builtin.throw @@ -14,3 +15,18 @@ We expect to be able to see locals like r in the debugger: Env level 1 abort baseNameOf break builtins derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true + + nix-repl> :quit + error: + … while evaluating the file '$TEST_DATA/regression_9918.nix': + + … while calling the 'throw' builtin + at $TEST_DATA/regression_9918.nix:3:7: + 2| r = []; + 3| x = builtins.throw r; + | ^ + 4| in + + … while evaluating the error message passed to builtin.throw + + error: cannot coerce a list to a string: [ ] diff --git a/tests/functional/repl_characterization/data/regression_l145.test b/tests/functional/repl_characterization/data/regression_l145.test index 2fe04d221..bab347d26 100644 --- a/tests/functional/repl_characterization/data/regression_l145.test +++ b/tests/functional/repl_characterization/data/regression_l145.test @@ -1,3 +1,4 @@ +@args --debugger info: breakpoint reached debugger should not crash now, but also not show any with variables @@ -12,3 +13,14 @@ debugger should not crash now, but also not show any with variables Env level 2 abort baseNameOf break builtins derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true + error: + … while evaluating the file '$TEST_DATA/regression_l145.nix': + + … while calling the 'break' builtin + at $TEST_DATA/regression_l145.nix:3:7: + 2| let + 3| x = builtins.break 1; + | ^ + 4| in + + error: breakpoint reached diff --git a/tests/functional/repl_characterization/data/stack_vars.test b/tests/functional/repl_characterization/data/stack_vars.test index 96ea5fe25..c9296eeaa 100644 --- a/tests/functional/repl_characterization/data/stack_vars.test +++ b/tests/functional/repl_characterization/data/stack_vars.test @@ -1,3 +1,4 @@ +@args --debugger trace: before outer break info: breakpoint reached @@ -24,7 +25,7 @@ If we :st past the frame in the backtrace with the meow in it, the meow should n nix-repl> :st 3 3: while calling a function - TEST_DATA/stack_vars.nix:5:7 + $TEST_DATA/stack_vars.nix:5:7 4| ); 5| b = builtins.trace "before outer break" ( @@ -58,9 +59,8 @@ If we :st past the frame in the backtrace with the meow in it, the meow should n 3 nix-repl> :st 3 - 3: while calling a function - TEST_DATA/stack_vars.nix:2:7 + $TEST_DATA/stack_vars.nix:2:7 1| let 2| a = builtins.trace "before inner break" ( @@ -72,3 +72,21 @@ If we :st past the frame in the backtrace with the meow in it, the meow should n Env level 1 abort baseNameOf break builtins derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true + + nix-repl> :quit + error: + … while calling the 'trace' builtin + at $TEST_DATA/stack_vars.nix:2:7: + 1| let + 2| a = builtins.trace "before inner break" ( + | ^ + 3| let meow' = 3; in builtins.break { msg = "hello"; } + + … while calling the 'break' builtin + at $TEST_DATA/stack_vars.nix:3:23: + 2| a = builtins.trace "before inner break" ( + 3| let meow' = 3; in builtins.break { msg = "hello"; } + | ^ + 4| ); + + error: breakpoint reached |