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

Use of fullstop character in --%context(<name>) #966

Closed
BrianGubbins opened this issue Jul 2, 2019 · 0 comments · Fixed by #1013
Labels
bug

Comments

@BrianGubbins
Copy link

@BrianGubbins BrianGubbins commented Jul 2, 2019

Describe the bug

Using a full stop character in --%context(<name>) will cause all other contexts in the suite to be executed under an entirely different suite as seen in the output section below. The reason for this I believe is because the way a context name is interpreted as a path to allow users to execute specific contexts.

Version Info

utPLSQL: v3.1.6.2735
SQL Developer: 19.1.0.094

To Reproduce

1. Create tests

create or replace package test_context_bug_1 is

  --%suite

  --%context(suite_1 context_1)

    --%test
    procedure test1;

  --%endcontext
  
  --%context(suite_1 context_2)

    --%test
    procedure test2;

  --%endcontext

end;
/

create or replace package body test_context_bug_1 is

  procedure test1 is
  begin
    ut.expect( 1 ).to_equal( 1 );
  end;

  procedure test2 is
  begin
    ut.expect( 1 ).to_equal( 1 );
  end;

end;
/

create or replace package test_context_bug_2 is

  --%suite
  
  --%context(suite_2 context_1)
  
    --%test
    procedure test1;

  --%endcontext
  
  --%context(suite_2 context_2)

    --%test
    procedure test2;

  --%endcontext

end;
/

create or replace package body test_context_bug_2 is

  procedure test1 is
  begin
    ut.expect( 1 ).to_equal( 1 );
  end;

  procedure test2 is
  begin
    ut.expect( 1 ).to_equal( 1 );
  end;

end;
/

2. Add a full stop in a context name

--%context(suite_2. context_2)  

3. Run tests

SET SERVEROUTPUT ON SIZE UNLIMITED
EXECUTE ut.run(); 

Outputs

Expected output:

test_context_bug_1
  suite_1 context_2
    test2 [.003 sec]
  suite_1 context_1
    test1 [.002 sec]
 
test_context_bug_2
  suite_2 context_2
    test2 [.002 sec]
  suite_2 context_1
    test1 [.002 sec]
 
Finished in .013272 seconds
4 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)
PL/SQL procedure successfully completed.

Actual output:

test_context_bug_1
  suite_2 context_1
    test1 [.003 sec]
  suite_1 context_2
    test2 [.001 sec]
  suite_1 context_1
    test1 [.001 sec]
 
test_context_bug_2
  suite_2. context_2
    test2 [.003 sec]
 
Finished in .01466 seconds
4 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)
PL/SQL procedure successfully completed.

Expected behavior

When a full stop is present in --%context(<name>) the other contexts in the suite shouldn't be executed under another suite.

@jgebal jgebal added the bug label Jul 2, 2019
@jgebal jgebal closed this in #1013 Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.