Files
lix/tests/functional2/repl_characterization/repl_basics/repl_basics.md
T
rootile 1a1234cf68 f2: lay foundations for repl testing
Change-Id: I0f5588adbf4ea11e2846b2a3655308d1dfb711b0
2026-06-09 14:06:04 +02:00

1.2 KiB

Basic repl test

Disable error traces, because we have the show-trace setting enabled

:te
not showing error traces

trivial addition:

1 + 1
2

Lets check if docs work

:doc builtins.add
Synopsis: builtins.add e1 e2


    Return the sum of the numbers e1 and e2.

Error printing

no trace by default

f = a: "" + a
f 2
Added f.

error:
       … while concatenating
         at «string»:1:11:
            1| f = a: "" + a
             |           ^

       error: cannot coerce an integer to a string: 2

show trace when enabled

:te
f 2
showing error traces

error:
       … from call site
         at «string»:1:1:
            1| f 2
             | ^

       … while calling anonymous lambda
         at «string»:1:5:
            1| f = a: "" + a
             |     ^

       … while concatenating
         at «string»:1:11:
            1| f = a: "" + a
             |           ^

       error: cannot coerce an integer to a string: 2

test if markdown does things correctly

:p __replaceStrings ["a"] ["`"] "\naaa\n"

```