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

Skip to content

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

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

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

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

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

Comments

@BrianGubbins
Copy link

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.

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