tests(f2/repl): migrate builtins_warn.test

Change-Id: Iaed1fb8651840b855ec7bdf5087681dc5eb9d54c
This commit is contained in:
rootile
2026-06-09 19:40:07 +02:00
parent 99175779c4
commit ab149a6cd8
3 changed files with 37 additions and 14 deletions
@@ -1,13 +0,0 @@
@args --debugger --option debugger-on-warn true
Enter debugger with debugger-on-warn set.
nix-repl> let inspect = v: builtins.warn "inspect is deprecated" (throw "this happens after"); in inspect { }
warning: inspect is deprecated
warning: builtins.warn reached
Continuing after the warn then breaks on the `throw`
nix-repl> :c
error: this happens after
Finally, continuing after that error exits and prints the error
nix-repl> :c
error: this happens after
@@ -176,7 +176,6 @@ TEST_F(ReplSessionTest, tidy)
runReplTestPath(#name); \
}
REPL_TEST(builtins_warn)
REPL_TEST(no_nested_debuggers);
REPL_TEST(regression_9917);
REPL_TEST(regression_9918);
@@ -0,0 +1,37 @@
---
args: ['--debugger', '--option', 'debugger-on-warn', 'true']
---
Enter debugger with debugger-on-warn set.
```nix
let inspect = v: builtins.warn "inspect is deprecated" (throw "this happens after"); in inspect { }
```
```output
warning: inspect is deprecated
warning: builtins.warn reached
Added 2 variables.
```
Continue after the warn then breaks on the `throw`
```nix
:c
```
```output
error: this happens after
Added 2 variables.
```
Finally, continue after that error exits and prints the error
```nix
:c
```
```output
error: this happens after
```