tests(f2/repl): migrate basic tests

Change-Id: I22241734a7249d376c86b3a226c5f1a82c03fd33
This commit is contained in:
rootile
2026-06-11 16:19:20 +02:00
parent f7ce20d879
commit ab8cdcc9b8
9 changed files with 286 additions and 208 deletions
@@ -0,0 +1,44 @@
Errors at the top of an expression are printed normally:
```nix
builtins.throw "Evil puppy detected!!!"
```
```output
error:
… caused by explicit throw
at «string»:1:1:
1| builtins.throw "Evil puppy detected!!!"
| ^
error: Evil puppy detected!!!
```
Errors in attribute values are printed inline, to make it easier to explore
values like nixpkgs where some parts of the value fail to evaluate:
```nix
{ puppy = builtins.throw "This puppy is EVIL!!!"; puppy2 = "This puppy is GOOD :)"; }
```
```output
{
puppy = «error: This puppy is EVIL!!!»;
puppy2 = "This puppy is GOOD :)";
}
```
Same for list values:
```nix
[ (builtins.throw "This puppy is EVIL!!!") ("This puppy is GOOD :)") ]
```
```output
[
«error: This puppy is EVIL!!!»
"This puppy is GOOD :)"
]
```