Skip to content

Running single test from package body fails with string literals containing "create package" #1

Closed
@jgebal

Description

@jgebal

When trying to execute test: test_expect_not_to_be_null.blob_not_null from utPLSQL test suites, the extension generates the following call:

SET SERVEROUTPUT ON SIZE 1000000
EXECUTE ut.run(''||gc_varray_name||'.drop_types');

The body of package can be seen here

It has constants at the top of the package body.

create or replace package body test_expect_not_to_be_null
is
    gc_object_name constant varchar2(30) := 't_not_to_be_null_test';
    gc_nested_table_name constant varchar2(30) := 'tt_not_to_be_null_test';
    gc_varray_name constant varchar2(30) := 'tv_not_to_be_null_test';

    procedure cleanup_expectations
    is
    begin
        ut3.ut_expectation_processor.clear_expectations();
    end;

    procedure create_types
    is
        pragma autonomous_transaction;
    begin
        execute immediate 'create type '||gc_object_name||' is object (dummy number)';
        execute immediate 'create type '||gc_nested_table_name||' is table of number';
        execute immediate 'create type '||gc_varray_name||' is varray(1) of number';
    end;

    procedure drop_types
    is
        pragma autonomous_transaction;
    begin
        execute immediate 'drop type '||gc_object_name;
        execute immediate 'drop type '||gc_nested_table_name;
        execute immediate 'drop type '||gc_varray_name;
    end;

    procedure blob_not_null
    is
    begin
        --Act
        execute immediate expectations_helpers.unary_expectation_block('not_to_be_null', 'blob', 'to_blob(''abc'')');
        --Assert
        ut.expect(anydata.convertCollection(ut3.ut_expectation_processor.get_failed_expectations())).to_be_empty();
    end;

--and so on...

end;

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions