Skip to content

Block

Background

Given a file named "pen.json" with:

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

Define a variable

Given a file named "Foo.pen" with:

f = \(x number) number {
  y = x

  y
}

When I run pen build

Then the exit status should be 0.

Call a function

Given a file named "Foo.pen" with:

f = \() none {
  none
}

g = \() none {
  f()

  none
}

When I run pen build

Then the exit status should be 0.

Use if expression

Given a file named "Foo.pen" with:

f = \() none {
  none
}

g = \() none {
  none
}

h = \(x boolean) none {
  if x {
    f()
  } else {
    g()
  }

  none
}

When I run pen build

Then the exit status should be 0.