From 9290a69ab375dcc1317c79b04e14d733d5dbc35e Mon Sep 17 00:00:00 2001 From: ivojawer Date: Tue, 26 Mar 2024 15:46:23 -0300 Subject: [PATCH 1/2] failing test --- test/printer.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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', () => { From 816d1e233beafe907e42e2ac0f16fdf744cc5afa Mon Sep 17 00:00:00 2001 From: ivojawer Date: Tue, 26 Mar 2024 15:47:59 -0300 Subject: [PATCH 2/2] 'only' keyword on tests --- src/printer/print.ts | 1 + 1 file changed, 1 insertion(+) 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)),