Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding "beforeall"/"beforeeach" annotations on the context level breaks annotation parser #672

Closed
@nrogachev

Description

@nrogachev

utPLSQL version v3.1.1.1868

The following test package (bodies of all procedures are empty):

`CREATE OR REPLACE PACKAGE TestPkg1
AS

--%suite(Some desc)
--%suitepath(de.suit1)

--%beforeall
PROCEDURE befall;

--%afterall
PROCEDURE aftall;

--%beforeeach
PROCEDURE befeach;

--%context(some ctx 1)
--beforeall
PROCEDURE befallctx;

--%test(My Test 1)
PROCEDURE test1;

--%endcontext

--%context(some ctx 2)
--beforeeach
PROCEDURE befallctx2;

--%test(My Test 2)
PROCEDURE test2;

--%endcontext

END TestPkg1;`

See that annotations inside context are disabled here.

Result:

`de
suit1
Some desc
some ctx 1
My Test 1 [.005 sec]
some ctx 2
My Test 2 [.005 sec]

Finished in .020437 seconds
2 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)`

If we enable the annotations

`CREATE OR REPLACE PACKAGE TestPkg1
AS

--%suite(Some desc)
--%suitepath(de.suit1)

--%beforeall
PROCEDURE befall;

--%afterall
PROCEDURE aftall;

--%beforeeach
PROCEDURE befeach;

--%context(some ctx 1)
--%beforeall
PROCEDURE befallctx;

--%test(My Test 1)
PROCEDURE test1;

--%endcontext

--%context(some ctx 2)
--%beforeeach
PROCEDURE befallctx2;

--%test(My Test 2)
PROCEDURE test2;

--%endcontext

END TestPkg1;
/`

we get this:

`de
suit1
Some desc
My Test 1 [.013 sec]
My Test 2 [.009 sec]

Warnings:

  1. de.suit1.testpkg1
    Invalid annotation "--%endcontext". Cannot find preceding "--%context". Annotation ignored.
    at "PESPLSQL.TESTPKG1", line 23
  2. de.suit1.testpkg1
    Invalid annotation "--%endcontext". Cannot find preceding "--%context". Annotation ignored.
    at "PESPLSQL.TESTPKG1", line 32

Finished in .048046 seconds
2 tests, 0 failed, 0 errored, 0 disabled, 2 warning(s)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions