Removed tests, as they were somewhat irrelevant.
This commit is contained in:
parent
9d375d3d79
commit
2683daf16c
|
@ -1,16 +0,0 @@
|
||||||
/* output: 1 */
|
|
||||||
let
|
|
||||||
function indentstring (text : string, indent : string) : string =
|
|
||||||
let var out := indent
|
|
||||||
var newline_and_indent := concat("\n", indent)
|
|
||||||
var char := ""
|
|
||||||
in for i := 0 to size(text) - 1 do
|
|
||||||
( char := substring (text, i, 1)
|
|
||||||
; out := concat(out, if char <> "\n"
|
|
||||||
then char
|
|
||||||
else newline_and_indent));
|
|
||||||
out
|
|
||||||
end
|
|
||||||
in
|
|
||||||
indentstring("Hello\nWorld", " ") = " Hello\n World"
|
|
||||||
end
|
|
|
@ -1,17 +0,0 @@
|
||||||
/* print: |00011110| */
|
|
||||||
let
|
|
||||||
function is_whitespace (char:string) : int =
|
|
||||||
(char = "" | char = "\n" | char = " " | char = "\t")
|
|
||||||
|
|
||||||
function testchar(char:string) =
|
|
||||||
if is_whitespace(char) then print("1") else print("0")
|
|
||||||
in
|
|
||||||
testchar("a");
|
|
||||||
testchar("2");
|
|
||||||
testchar("321");
|
|
||||||
testchar("");
|
|
||||||
testchar("\n");
|
|
||||||
testchar(" ");
|
|
||||||
testchar("\t");
|
|
||||||
testchar("Recursion")
|
|
||||||
end
|
|
|
@ -1,2 +0,0 @@
|
||||||
/* print: |hello| */
|
|
||||||
print(concat("", concat("hello", "")))
|
|
Loading…
Reference in New Issue
Block a user