Character
Check if a value is a character
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Examples
expression |
---|
#\A |
#\newline |
(integer->char 65) |
Check if a value is a whitespace
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 | B |
#\newline | A |
#\return | A |
#\space | A |
#\tab | 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 a newline character
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly:
Compare characters
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
predicate | characters | output |
---|---|---|
char=? | #\A #\A | A |
char=? | #\A #\B | B |
char=? | #\A #\A #\A | A |
char=? | #\A #\A #\B | B |
char<? | #\A #\B | A |
char<? | #\A #\A | B |
char<? | #\A #\B #\C | A |
char<? | #\A #\B #\B | B |