Write
Write a byte
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Write a character
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Write an escaped character
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
#\a |
#\A |
#\\ |
#( |
Write an escaped special character
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
#\alarm |
#\backspace |
#\delete |
#\escape |
#\newline |
#\null |
#\return |
#\space |
#\tab |
Write a string
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “Hello, world!”.
Write a special character in a string
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
\n |
\t |
” |
Write a boolean
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
#f |
#t |
Write a list
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
() |
(1) |
(1 2) |
(1 2 3) |
(1 (1 2) (3 4 5)) |
(1 . 2) |
(1 2 . 3) |
Write a number
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
0 |
1 |
42 |
-1 |
-42 |
Write a procedure
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “#procedure”.
Write a record
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “#record”.
Write a string
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly ""<value>"".
Examples
value |
---|
foo |
Hello, world! |
\n |
\t |
\r |
\n\t\r |
Write a symbol
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “foo”.
Write a vector
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
#() |
#(1) |
#(1 2) |
#(1 2 3) |
#(1 #(1 2) #(3 4 5)) |
Write a bytevector
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
#u8() |
#u8(1) |
#u8(1 2) |
#u8(1 2 3) |
Write to a port
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “(42 foo #f)”.
Write a quote
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<value>”.
Examples
value |
---|
’() |
`() |
`(,1) |
(quote) |
(quasiquote) |
(unquote) |
(quote . 42) |
(quasiquote . 42) |
(unquote . 42) |
Write a value in a collection
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
value | output |
---|---|
(#\a) | (#\a) |
(#\space) | (#\space) |
(“foo”) | (“foo”) |
((#\a)) | ((#\a)) |
((#\space)) | ((#\space)) |
((“foo”)) | ((“foo”)) |
#(#\a) | #(#\a) |
#(#\space) | #(#\space) |
#(“foo”) | #(“foo”) |
#(#(#\a)) | #(#(#\a)) |
#(#(#\space)) | #(#(#\space)) |
#(#(“foo”)) | #(#(“foo”)) |
Display a value
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
value | output |
---|---|
#\a | a |
”foo” | foo |
(#\a) | (a) |
(#\space) | ( ) |
(“foo”) | (foo) |
((#\a)) | ((a)) |
((#\space)) | (( )) |
((“foo”)) | ((foo)) |
#(#\a) | #(a) |
#(#\space) | #( ) |
#(“foo”) | #(foo) |
#(#(#\a)) | #(#(a)) |
#(#(#\space)) | #(#( )) |
#(#(“foo”)) | #(#(foo)) |