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 · Fixed by #1035
Closed

Nested Contexts get mixed up #1034

pesse opened this issue Dec 19, 2019 · 1 comment · Fixed by #1035
Assignees
Labels
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants