Skip to content

Building packages

Given a file named “pen.json” with:

{
"type": "application",
"dependencies": {
"Os": "pen:///os"
}
}

And a file named “main.pen” with:

import Os'Context { Context }
main = \(ctx context) none {
none
}

When I successfully run pen build

Then I successfully run ./app.

Given a file named “pen.json” with:

{
"type": "library",
"dependencies": {}
}

And a file named “Foo.pen” with:

f = \(x number) number {
x
}

When I run pen build

Then the exit status should be 0.

Given a file named “pen.json” with:

{
"type": "application",
"dependencies": {
"Os": "pen:///os-sync"
}
}

And a file named “main.pen” with:

import Os'Context { Context }
main = \(ctx context) none {
none
}

When I successfully run pen build --target \<target\>

Then the exit status should be 0.

target
i686-unknown-linux-musl
x86_64-unknown-linux-musl
aarch64-unknown-linux-musl
wasm32-wasip2

Given a file named “pen.json” with:

{
"type": "library",
"dependencies": {}
}

And a file named “Foo.pen” with:

f = \(x number) number {
x
}

When I successfully run pen build --target \<target\>

Then the exit status should be 0.

target
i686-unknown-linux-musl
x86_64-unknown-linux-musl
aarch64-unknown-linux-musl
wasm32-wasip2

Given a file named “pen.json” with:

{
"type": "application",
"dependencies": {
"Os": "pen:///os"
}
}

And a file named “main.pen” with:

import Os'Context { Context }
main = \(ctx context) none {
none
}

And I successfully run pen build

And I successfully run ./app

And the stdout from “./app” should contain exactly “”

When a file named “main.pen” with:

import Os'Context { Context }
import Os'File
main = \(ctx context) none {
_ = File'Write(ctx.Os, File'StdOut(), "hello")
none
}

And I successfully run pen build

Then I successfully run ./app

And the stdout from “./app” should contain exactly “hello”.