diff --git a/src/printer/print.ts b/src/printer/print.ts index f7bd5f47..a39152b6 100644 --- a/src/printer/print.ts +++ b/src/printer/print.ts @@ -169,6 +169,7 @@ const formatParameter: Formatter = node => node.name const formatTest: FormatterWithContext = context => node => { return intersperse(WS, [ + ...node.isOnly ? [KEYWORDS.ONLY] : [], KEYWORDS.TEST, node.name, body(context.nest)(formatSentences(context)(node.body.sentences)), diff --git a/test/printer.test.ts b/test/printer.test.ts index 96bdc556..db1df019 100644 --- a/test/printer.test.ts +++ b/test/printer.test.ts @@ -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', () => {