Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windows linebreak discrepancy #5383

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions unison-src/transcripts/multiline-strings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```unison
string =
"""
a
b

c
"""
```

```ucm
scratch/main> add
scratch/main> edit string
```
51 changes: 51 additions & 0 deletions unison-src/transcripts/multiline-strings.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
``` unison
string =
"""
a
b

c
"""
```

``` ucm

Loading changes detected in scratch.u.

I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:

⍟ These new definitions are ok to `add`:

string : ##Text

```
``` ucm
scratch/main> add

⍟ I've added these definitions:

string : ##Text

scratch/main> edit string

☝️

I added 1 definitions to the top of scratch.u

You can edit them there, then run `update` to replace the
definitions currently in this namespace.

```
``` unison:added-by-ucm scratch.u
string : ##Text
string =
"""
a
b

c
"""
```

4 changes: 4 additions & 0 deletions unison-src/transcripts/multiline-strings0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```ucm
scratch/main> clone @unison/http/releases/3.3.2
@unison/http/releases/3.3.2> edit HttpResponse.pattern.statusLine.testReasonIsOptional tests.testFromStream
```
61 changes: 61 additions & 0 deletions unison-src/transcripts/multiline-strings0.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
``` ucm
scratch/main> clone @unison/http/releases/3.3.2

Downloaded 23893 entities.

Cloned @unison/http/releases/3.3.2.

@unison/http/releases/3.3.2> edit HttpResponse.pattern.statusLine.testReasonIsOptional tests.testFromStream

☝️

I added 2 definitions to the top of scratch.u

You can edit them there, then run `update` to replace the
definitions currently in this namespace.

```
``` unison:added-by-ucm scratch.u
test> HttpResponse.pattern.statusLine.testReasonIsOptional =
parsed = catch do
statusNoReason =
"""
HTTP/1.1 200
rest
"""
IPattern.run statusLine statusNoReason
verifyAndIgnore do
assertEquals parsed (Right (Some (["HTTP/1.1", "200", ""], "\r\nrest")))

test> tests.testFromStream =
verifyAndIgnore do
use Path /
use Text toUtf8
request =
"""
GET /docs?%25wei?rd=%26he+llo/&%25wei?rd=+th%23er%3de%25&simple=foo HTTP/1.0
Content-Type: text/plain
Content-Length: 12

Hello World!
"""
stream = do emit (toUtf8 request)
actual = HttpRequest.fromStream stream
headers =
Headers.fromList
[("Content-Type", "text/plain"), ("Content-Length", "12")]
expected =
HttpRequest
GET
Version.http10
(URI
(Scheme "")
None
(root / "docs")
(RawQuery "%25wei?rd=%26he+llo/&%25wei?rd=+th%23er%3de%25&simple=foo")
Fragment.empty)
headers
(Body (toUtf8 "Hello World!"))
test.ensureEqual expected actual
```

Loading