Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Contexts get mixed up #1034

Closed
pesse opened this issue Dec 19, 2019 · 1 comment
Closed

Nested Contexts get mixed up #1034

pesse opened this issue Dec 19, 2019 · 1 comment
Assignees
Labels
bug
Milestone

Comments

@pesse
Copy link
Member

@pesse pesse commented Dec 19, 2019

utPLSQL-Version: 3.1.9

Consider the following test-suite with nested-contexts:

create or replace package ut_context_test as

  -- %suite(Context Test)
  -- %suitepath(context)

  -- %context(Level 1)

    -- %context(Level 1.1)

      -- %test(Test 1.1.1)
      procedure test_1_1_1;
      -- %test(Test 1.1.2)
      procedure test_1_1_2;

    -- %endcontext

  -- %endcontext

  -- %context(Level 2)

    -- %test(Test 2.1)
    procedure test_2_1;

  -- %endcontext
end;
/

Expectation would be:

context
  Context Test
    Level 1
      Level 1.1
        Test 1.1.1 [,016 sec] (FAILED - 2)
        Test 1.1.2 [,005 sec] (FAILED - 3)
    Level 2
      Test 2.1 [,016 sec] (FAILED - 1)

But at the moment it's interpreted like that:

context
  Context Test
    Level 1
      Level 2
        Test 2.1 [,016 sec] (FAILED - 1)
      Level 1.1
        Test 1.1.1 [,016 sec] (FAILED - 2)
        Test 1.1.2 [,005 sec] (FAILED - 3)

It looks like consecutive %endcontext are not interpreted correctly so that termination doesn't happen at the correct time/place

@pesse

This comment has been minimized.

Copy link
Member Author

@pesse pesse commented Dec 19, 2019

I think I can fix this.

@pesse pesse self-assigned this Dec 19, 2019
@pesse pesse added the bug label Dec 19, 2019
pesse added a commit that referenced this issue Dec 19, 2019
We need to make sure to calculate the corrent %endcontext annotation, not just the first that is greater than the next nested %context.
To operate correctly during recursion we also need information about the parent %endcontext position

Fixes #1034
@jgebal jgebal added this to the 3.1.10 milestone Dec 20, 2019
@jgebal jgebal closed this in #1035 Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.