diff --git a/test/validations/malformedSentence.wlk b/test/validations/malformedSentence.wlk new file mode 100644 index 00000000..a65da38f --- /dev/null +++ b/test/validations/malformedSentence.wlk @@ -0,0 +1,14 @@ +@Expect(code="malformedMember", level="error") +object pepita { + const energy = 100 + + method wrongSyntax() = @Expect(code="malformedSentence", level="error")#2342amskdl; + + method fly(kms) @Expect(code="malformedSentence", level="error") { + return energy = kms + } + + // first 'energy' is correct and the next one is + // parsed as a "malformedMember" + method eat(food) = energy energy +} \ No newline at end of file diff --git a/test/validations/missingReference.wlk b/test/validations/missingReference.wlk index fb2ee339..bcaa9424 100644 --- a/test/validations/missingReference.wlk +++ b/test/validations/missingReference.wlk @@ -2,14 +2,14 @@ import @Expect(code="missingReference", level="error") inexistentFile.* object pepita { - method energia() = @Expect(code="missingReference", level="error") energia + method energia() = (@Expect(code="missingReference", level="error") energia) method comer(p) { @Expect(code="missingReference", level="error", path="variable") energia = 100 } - method estaCansada() = @Expect(code="missingReference", level="error") energia < 10 + method estaCansada() = (@Expect(code="missingReference", level="error") energia < 10) method methodName() { self.comer(@Expect(code="missingReference", level="error") energia) diff --git a/test/validations/shouldNotUseVoidMethodAsValue.wlk b/test/validations/shouldNotUseVoidMethodAsValue.wlk index ce4378f3..23575a7b 100644 --- a/test/validations/shouldNotUseVoidMethodAsValue.wlk +++ b/test/validations/shouldNotUseVoidMethodAsValue.wlk @@ -72,7 +72,7 @@ class MethodsCalledOnWellKnowObjects inherits A { return new B(a = @Expect(code = "shouldNotUseVoidMethodAsValue", message = "error") (pepita.ingest(10))) } - method asExpressionOnMethodShortcut() = @Expect(code = "shouldNotUseVoidMethodAsValue", message = "error") (pepita.ingest(10)) + method asExpressionOnMethodShortcut() = (@Expect(code = "shouldNotUseVoidMethodAsValue", message = "error") (pepita.ingest(10))) } class B { diff --git a/test/validations/shouldReturnAValueOnAllFlows.wlk b/test/validations/shouldReturnAValueOnAllFlows.wlk index 7b38e3a5..c1809c5e 100644 --- a/test/validations/shouldReturnAValueOnAllFlows.wlk +++ b/test/validations/shouldReturnAValueOnAllFlows.wlk @@ -148,8 +148,8 @@ object joaquin { // ===================================================================================== method testValorDevueltoConMetodoGet() = - @Expect(code="shouldReturnAValueOnAllFlows", level="error") - if (tocaEnGrupo) 5 + (@Expect(code="shouldReturnAValueOnAllFlows", level="error") + if (tocaEnGrupo) 5) method validarFelicidad() { assert.equals(10, @Expect(code="shouldReturnAValueOnAllFlows", level="error") if (tocaEnGrupo) 5)