mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 07:17:25 +03:00
Add a doc test case for evaluating cases
This commit is contained in:
parent
ae9a7c80be
commit
7d56385db1
@ -73,6 +73,14 @@ id x = x
|
||||
id (sqr 10)
|
||||
```
|
||||
|
||||
also:
|
||||
|
||||
```
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
```
|
||||
|
||||
To include a typechecked snippet of code without evaluating it, you can do:
|
||||
|
||||
@typecheck ```
|
||||
|
@ -257,6 +257,14 @@ and the rendered output using `display`:
|
||||
id (sqr 10)
|
||||
```
|
||||
|
||||
also:
|
||||
|
||||
```
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
```
|
||||
|
||||
To include a typechecked snippet of code without
|
||||
evaluating it, you can do:
|
||||
|
||||
@ -281,6 +289,14 @@ and the rendered output using `display`:
|
||||
⧨
|
||||
100
|
||||
|
||||
also:
|
||||
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
⧨
|
||||
"hi"
|
||||
|
||||
To include a typechecked snippet of code without evaluating
|
||||
it, you can do:
|
||||
|
||||
@ -626,6 +642,14 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub
|
||||
⧨
|
||||
100
|
||||
|
||||
also:
|
||||
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
⧨
|
||||
"hi"
|
||||
|
||||
To include a typechecked snippet of code without
|
||||
evaluating it, you can do:
|
||||
|
||||
|
@ -77,6 +77,14 @@ We can display the guide before and after adding it to the codebase:
|
||||
⧨
|
||||
100
|
||||
|
||||
also:
|
||||
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
⧨
|
||||
"hi"
|
||||
|
||||
To include a typechecked snippet of code without
|
||||
evaluating it, you can do:
|
||||
|
||||
@ -278,6 +286,14 @@ We can display the guide before and after adding it to the codebase:
|
||||
⧨
|
||||
100
|
||||
|
||||
also:
|
||||
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
⧨
|
||||
"hi"
|
||||
|
||||
To include a typechecked snippet of code without
|
||||
evaluating it, you can do:
|
||||
|
||||
@ -485,6 +501,14 @@ rendered = Pretty.get (docFormatConsole doc.guide)
|
||||
⧨
|
||||
100
|
||||
|
||||
also:
|
||||
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
⧨
|
||||
"hi"
|
||||
|
||||
To include a typechecked snippet of code without
|
||||
evaluating it, you can do:
|
||||
|
||||
@ -679,6 +703,14 @@ rendered = Pretty.get (docFormatConsole doc.guide)
|
||||
⧨
|
||||
100
|
||||
|
||||
also:
|
||||
|
||||
match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye"
|
||||
⧨
|
||||
"hi"
|
||||
|
||||
To include a typechecked snippet of code without
|
||||
evaluating it, you can do:
|
||||
|
||||
@ -1795,6 +1827,29 @@ rendered = Pretty.get (docFormatConsole doc.guide)
|
||||
!Indent
|
||||
(!Lit (Right (Plain " ")))
|
||||
(!Lit (Right (Plain " ")))
|
||||
(!Annotated.Group
|
||||
(!Wrap
|
||||
(!Lit (Right (Plain "also:"))))),
|
||||
!Lit (Right (Plain "\n")),
|
||||
!Lit (Right (Plain "\n")),
|
||||
!Indent
|
||||
(!Lit (Right (Plain " ")))
|
||||
(!Lit (Right (Plain " ")))
|
||||
(!Annotated.Group
|
||||
(!Lit
|
||||
(Left
|
||||
(Eval
|
||||
(Term.Term
|
||||
(Any
|
||||
(_ ->
|
||||
(match 1 with
|
||||
1 -> "hi"
|
||||
_ -> "goodbye")))))))),
|
||||
!Lit (Right (Plain "\n")),
|
||||
!Lit (Right (Plain "\n")),
|
||||
!Indent
|
||||
(!Lit (Right (Plain " ")))
|
||||
(!Lit (Right (Plain " ")))
|
||||
(!Annotated.Group
|
||||
(!Wrap
|
||||
(!Annotated.Append
|
||||
|
Loading…
Reference in New Issue
Block a user