Skip to content

Commit

Permalink
Merge pull request #229 from uqbar-project/only-test-formatter
Browse files Browse the repository at this point in the history
Only test printer
  • Loading branch information
ivojawer authored Mar 27, 2024
2 parents 1dd3eb3 + 816d1e2 commit 55a2803
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/printer/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ const formatParameter: Formatter<Parameter> = node => node.name

const formatTest: FormatterWithContext<Test> = context => node => {
return intersperse(WS, [
...node.isOnly ? [KEYWORDS.ONLY] : [],
KEYWORDS.TEST,
node.name,
body(context.nest)(formatSentences(context)(node.body.sentences)),
Expand Down
13 changes: 13 additions & 0 deletions test/printer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,19 @@ describe('Wollok Printer', () => {
}`)
})
})

describe('Test', () => {
it('only test', () => {
'only test "aSimpleTest"{assert.that(true)} test "anotherTest" {assert.that(true)}'.should.be.formattedTo(`
only test "aSimpleTest" {
assert.that(true)
}
test "anotherTest" {
assert.that(true)
}`)
})
})
})
describe('Object', () => {
it('testBasicObjectDefinition', () => {
Expand Down

0 comments on commit 55a2803

Please sign in to comment.