Skip to content

Commit

Permalink
Format features directory (#2312)
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe authored Feb 14, 2024
1 parent a7536ae commit 7e40515
Show file tree
Hide file tree
Showing 39 changed files with 2,178 additions and 2,178 deletions.
138 changes: 69 additions & 69 deletions features/commands/build.feature
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
Feature: Building packages
Scenario: Build an application package
Given a file named "pen.json" with:
"""json
{
"type": "application",
"dependencies": {
"Os": "pen:///os"
"""json
{
"type": "application",
"dependencies": {
"Os": "pen:///os"
}
}
}
"""
"""
And a file named "main.pen" with:
"""pen
import Os'Context { Context }
"""pen
import Os'Context { Context }
main = \(ctx context) none {
none
}
"""
main = \(ctx context) none {
none
}
"""
When I successfully run `pen build`
Then I successfully run `./app`

Scenario: Build a library package
Given a file named "pen.json" with:
"""json
{
"type": "library",
"dependencies": {}
}
"""
"""json
{
"type": "library",
"dependencies": {}
}
"""
And a file named "Foo.pen" with:
"""pen
f = \(x number) number {
x
}
"""
"""pen
f = \(x number) number {
x
}
"""
When I run `pen build`
Then the exit status should be 0

Scenario Outline: Cross-build an application package
Given a file named "pen.json" with:
"""json
{
"type": "application",
"dependencies": {
"Os": "pen:///os-sync"
"""json
{
"type": "application",
"dependencies": {
"Os": "pen:///os-sync"
}
}
}
"""
"""
And a file named "main.pen" with:
"""pen
import Os'Context { Context }
"""pen
import Os'Context { Context }
main = \(ctx context) none {
none
}
"""
main = \(ctx context) none {
none
}
"""
And I successfully run `rustup target add <target>`
When I successfully run `pen build --target <target>`
Then the exit status should be 0
Expand All @@ -68,18 +68,18 @@ Feature: Building packages

Scenario Outline: Cross-build a library package
Given a file named "pen.json" with:
"""json
{
"type": "library",
"dependencies": {}
}
"""
"""json
{
"type": "library",
"dependencies": {}
}
"""
And a file named "Foo.pen" with:
"""pen
f = \(x number) number {
x
}
"""
"""pen
f = \(x number) number {
x
}
"""
And I successfully run `rustup target add <target>`
When I successfully run `pen build --target <target>`
Then the exit status should be 0
Expand All @@ -93,36 +93,36 @@ Feature: Building packages

Scenario: Build an application package again
Given a file named "pen.json" with:
"""json
{
"type": "application",
"dependencies": {
"Os": "pen:///os"
"""json
{
"type": "application",
"dependencies": {
"Os": "pen:///os"
}
}
}
"""
"""
And a file named "main.pen" with:
"""pen
import Os'Context { Context }
"""pen
import Os'Context { Context }
main = \(ctx context) none {
none
}
"""
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:
"""pen
import Os'Context { Context }
import Os'File
"""pen
import Os'Context { Context }
import Os'File
main = \(ctx context) none {
_ = File'Write(ctx.Os, File'StdOut(), "hello")
main = \(ctx context) none {
_ = File'Write(ctx.Os, File'StdOut(), "hello")
none
}
"""
none
}
"""
And I successfully run `pen build`
Then I successfully run `./app`
And the stdout from "./app" should contain exactly "hello"
38 changes: 19 additions & 19 deletions features/commands/document.feature
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Feature: Generating documentation for a package
Background:
Given a file named "pen.json" with:
"""json
{
"type": "library",
"dependencies": {}
}
"""
"""json
{
"type": "library",
"dependencies": {}
}
"""

Scenario: Generate documentation for a package
Given a file named "Foo.pen" with:
"""pen
# Do something nice.
Foo = \() none {
none
}
"""
"""pen
# Do something nice.
Foo = \() none {
none
}
"""
When I run the following script:
"""sh
pen document \
--name Foo \
--url https://github.com/foo/foo \
--description "This package is cool." \
> Foo.md
"""
"""sh
pen document \
--name Foo \
--url https://github.com/foo/foo \
--description "This package is cool." \
> Foo.md
"""
Then a file named "Foo.md" should contain "`Foo` package"
42 changes: 21 additions & 21 deletions features/commands/format.feature
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
Feature: Formatting module files
Background:
Given a file named "pen.json" with:
"""json
{
"type": "library",
"dependencies": {}
}
"""
"""json
{
"type": "library",
"dependencies": {}
}
"""

Scenario: Format module files
Given a file named "Foo.pen" with:
"""pen
Foo = \() none {
"""pen
Foo = \() none {
none
}
"""
none
}
"""
When I successfully run `pen format`
Then a file named "Foo.pen" should contain exactly:
"""pen
Foo = \() none {
none
}
"""
"""pen
Foo = \() none {
none
}
"""

Scenario: Check if module files are formatted
Given a file named "Foo.pen" with:
"""pen
Foo = \() none {
"""pen
Foo = \() none {
none
}
"""
none
}
"""
When I run `pen format --checked`
Then the exit status should not be 0
Loading

0 comments on commit 7e40515

Please sign in to comment.