diff --git a/unison-src/transcripts/multiline-strings.md b/unison-src/transcripts/multiline-strings.md new file mode 100644 index 0000000000..1a3f8101c6 --- /dev/null +++ b/unison-src/transcripts/multiline-strings.md @@ -0,0 +1,14 @@ +```unison +string = + """ + a + b + + c + """ +``` + +```ucm +scratch/main> add +scratch/main> edit string +``` diff --git a/unison-src/transcripts/multiline-strings.output.md b/unison-src/transcripts/multiline-strings.output.md new file mode 100644 index 0000000000..24fd0e3193 --- /dev/null +++ b/unison-src/transcripts/multiline-strings.output.md @@ -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 + """ +``` + diff --git a/unison-src/transcripts/multiline-strings0.md b/unison-src/transcripts/multiline-strings0.md new file mode 100644 index 0000000000..4bf59c8e22 --- /dev/null +++ b/unison-src/transcripts/multiline-strings0.md @@ -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 +``` diff --git a/unison-src/transcripts/multiline-strings0.output.md b/unison-src/transcripts/multiline-strings0.output.md new file mode 100644 index 0000000000..157b003f6a --- /dev/null +++ b/unison-src/transcripts/multiline-strings0.output.md @@ -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 +``` +