Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Aug 9, 2024
1 parent bcf0ff6 commit c341cc4
Show file tree
Hide file tree
Showing 2 changed files with 2,837 additions and 6 deletions.
41 changes: 40 additions & 1 deletion unison-src/transcripts/definition-diff-api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
```ucm
diffs/main> builtins.merge
diffs/main> builtins.mergeio lib.builtins
diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.>
diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.-
```

```unison
Expand All @@ -8,6 +10,20 @@ term =
1 + 1
type Type = Type Nat
ability Stream a where
emit : a -> ()
take n s =
use Nat > -
h n = cases
{ emit a -> k } -> if n > 0
then
emit a
handle k() with h (n - 1)
else None
{ r } -> Some r
handle s() with h n
```

```ucm
Expand All @@ -21,6 +37,22 @@ term =
1 + 2
type Type a = Type a Text
ability Stream a where
emit : a -> ()
take n s =
use Nat > -
h n = cases
{ emit a -> k } ->
emit a
if n > 0
then handle k() with h (n - 1)
else None
{ r } -> Some r
if n > 0
then handle s () with h (n - 1)
else None
```

```ucm
Expand All @@ -33,6 +65,13 @@ Diff terms
GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=term&newTerm=term
```

More complex diff

```api
GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=take&newTerm=take
```


Diff types

```api
Expand Down
Loading

0 comments on commit c341cc4

Please sign in to comment.