Core
Background
Section titled “Background”Given a file named “pen.json” with:
{ "type": "library", "dependencies": { "Core": "pen:///core" }}Convert a number to a string
Section titled “Convert a number to a string”Given a file named “Foo.pen” with:
import Core'Number
f = \() string { Number'String(42)}When I run pen build
Then the exit status should be 0.
Sum numbers
Section titled “Sum numbers”Given a file named “Foo.pen” with:
import Core'Number
f = \() number { Number'Sum([number 1, 2, 3])}When I run pen build
Then the exit status should be 0.
Join strings
Section titled “Join strings”Given a file named “Foo.pen” with:
import Core'String
f = \() string { String'Join([string "hello", "world"], " ")}When I run pen build
Then the exit status should be 0.
Slice a string as bytes
Section titled “Slice a string as bytes”Given a file named “Foo.pen” with:
import Core'String'Byte
f = \() string { Byte'Slice("foo", 1, 2)}When I run pen build
Then the exit status should be 0.