Reputation: 21
I am new to UTPLSQL and i installed 3.04 version i checking column value ut.expect( o_ename ).to_equal('Ford'); o_ename will contain Ford.
but when i executed test case test is failing saying that testename Actual: 'FORD' (varchar2) was expected to equal: 'Ford' (varchar2) at "UT3.TESTPROC", line 11 ut.expect( o_ename ).to_equal('Ford');
Finished in .01 seconds 1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)
here are procedure and packages. CREATE OR REPLACE PROCEDURE p2(i_empno IN emp.empno%TYPE,o_ename OUT emp.ename%type) AS BEGIN p1(7902, o_ename); dbms_output.put_line('Inside P2 : Procedure P1 output is '||o_ename); END;
create or replace package testproc as -- %suite(find name)
--%test(testename)
procedure testename;
end;
create or replace package body testproc as procedure testename as
i_empno emp.empno%TYPE := 7902;
o_ename emp.ename%type;
BEGIN
p1(i_empno, o_ename);
dbms_output.put_line(o_ename);
ut.expect('Ford').to_equal('Ford');
ut.expect( o_ename ).to_equal('Ford');
END;
set serveroutput on begin ut.run('testproc'); end;
Failures:
1) testename Actual: 'FORD' (varchar2) was expected to equal: 'Ford' (varchar2) at "UT3.TESTPROC", line 11 ut.expect( o_ename ).to_equal('Ford');
Finished in .01 seconds 1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)
help me how to compare table column name with actual name
Upvotes: 1
Views: 239
Reputation: 146219
With SQL data case matters. The error message is quite clear: the actual value of the data is 'FORD'
but your expected value is 'Ford'
. The test correctly fails because these are two different strings.
The solution is quite simple - pass the correct expected value:
ut.expect( o_ename ).to_equal('FORD');
Upvotes: 1