Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
48abf1a
Initial checkin
lwasylow Jun 1, 2020
7041912
added expectation
lwasylow Jun 2, 2020
13d86b6
Adding more methods
lwasylow Jun 2, 2020
caeeb30
Adding contain and not contain
lwasylow Jun 2, 2020
8ff4f6b
Adding code and tests,.
lwasylow Jun 6, 2020
89cb0bc
Fixingtoo long names
lwasylow Jun 6, 2020
a5481ac
fixing issue
lwasylow Jun 6, 2020
9ee0e75
Update documentation and tests
lwasylow Jun 7, 2020
a660208
First code corrections
lwasylow Jun 14, 2020
ada1ea4
Resolving another comment
lwasylow Jun 14, 2020
fe1b0cb
Updating issues
lwasylow Jun 14, 2020
013db74
Update tble
lwasylow Jun 14, 2020
b5c73b4
Separated into two different matchers
jgebal Jun 19, 2020
2e721da
CHECKPOINT
lwasylow Jun 19, 2020
fbc0f26
Merge branch 'feature/rework_matcher' of https://github.com/utPLSQL/u…
lwasylow Jun 19, 2020
f182430
Update uninstall
lwasylow Jun 19, 2020
e3fb2d7
Update progress
lwasylow Jun 19, 2020
322e0a1
Making code a bit more readable
lwasylow Jun 19, 2020
ff15596
Added tests for `be_within_pct`
jgebal Jun 20, 2020
3cae9a2
Fixed test issue
jgebal Jun 20, 2020
22549db
Fixed stacktrace for failed expectations on chained matchers.
jgebal Jun 21, 2020
1d771a5
Update timestamps
lwasylow Jun 25, 2020
363c333
Fixed and simplified matcher
jgebal Jun 27, 2020
0ea8925
Fixed native dynamic SQL types compatibility for 11g
jgebal Jun 28, 2020
7c01afb
Fixed native dynamic SQL types compatibility for 11g
jgebal Jun 28, 2020
66d92fc
Merge branch 'develop' into feature/rework_matcher
jgebal Jan 28, 2022
590fb38
Improving test stability (flaky tests)
jgebal Jan 28, 2022
5e2642a
Removing reference to ut3_develop schema.
jgebal Jan 28, 2022
ed06e33
Relaxed sql-injection check to work with 11g2
jgebal Jan 28, 2022
38f3cbc
Fixed issues with comparison of dates&timestamps using interval year-…
jgebal Jan 30, 2022
86e84c8
Improving code coverage.
jgebal Jan 31, 2022
718ac0d
Improved test stability.
jgebal Jan 31, 2022
6dbef20
Fixing build process to build using develop branch as testing framewo…
jgebal Jan 31, 2022
25b55b4
Improving test coverage.
jgebal Jan 31, 2022
5b5a5c0
Improving matcher documentation
jgebal Jan 31, 2022
7fec0f9
Added tests for 0 value of actual and expected and actual greater tha…
jgebal Feb 2, 2022
fd7ef9c
Fixed issues with precission of distance. `NATURAL` is a subtype of i…
jgebal Feb 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed issues with precission of distance. NATURAL is a subtype of i…
…nteger and cannot be used to express a decimal distace value.

Improved tests coverage for various scenarios.
  • Loading branch information
jgebal committed Feb 2, 2022
commit fd7ef9c14111a48e03fff7851f990c7192539170
8 changes: 4 additions & 4 deletions source/expectations/ut_expectation.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ create or replace type body ut_expectation as
self.not_to( ut_contain(a_expected).negated() );
end;

member function to_be_within(a_dist natural) return ut_be_within is
member function to_be_within(a_dist number) return ut_be_within is
l_result ut_be_within;
begin
l_result := ut_be_within(a_dist);
Expand All @@ -718,15 +718,15 @@ create or replace type body ut_expectation as
return l_result;
end;

member function to_be_within_pct(a_dist natural) return ut_be_within_pct is
member function to_be_within_pct(a_dist number) return ut_be_within_pct is
l_result ut_be_within_pct;
begin
l_result := ut_be_within_pct(a_dist);
l_result.expectation := self;
return l_result;
end;

member function not_to_be_within(a_dist natural) return ut_be_within is
member function not_to_be_within(a_dist number) return ut_be_within is
l_result ut_be_within;
begin
l_result := treat( ut_be_within(a_dist).negated() as ut_be_within);
Expand All @@ -750,7 +750,7 @@ create or replace type body ut_expectation as
return l_result;
end;

member function not_to_be_within_pct(a_dist natural) return ut_be_within_pct is
member function not_to_be_within_pct(a_dist number) return ut_be_within_pct is
l_result ut_be_within_pct;
begin
l_result := treat( ut_be_within_pct(a_dist).negated() as ut_be_within_pct);
Expand Down
10 changes: 5 additions & 5 deletions source/expectations/ut_expectation.tps
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
create or replace type ut_expectation under ut_expectation_base(
create or replace type ut_expectation force under ut_expectation_base(
/*
utPLSQL - Version 3
Copyright 2016 - 2021 utPLSQL Project
Expand Down Expand Up @@ -164,14 +164,14 @@ create or replace type ut_expectation under ut_expectation_base(
member procedure to_contain(self in ut_expectation, a_expected anydata),
member procedure not_to_contain(self in ut_expectation, a_expected anydata),

member function to_be_within(a_dist natural) return ut_be_within,
member function to_be_within(a_dist number) return ut_be_within,
member function to_be_within(a_dist dsinterval_unconstrained) return ut_be_within,
member function to_be_within(a_dist yminterval_unconstrained) return ut_be_within,
member function to_be_within_pct(a_dist natural) return ut_be_within_pct,
member function not_to_be_within(a_dist natural) return ut_be_within,
member function to_be_within_pct(a_dist number) return ut_be_within_pct,
member function not_to_be_within(a_dist number) return ut_be_within,
member function not_to_be_within(a_dist dsinterval_unconstrained) return ut_be_within,
member function not_to_be_within(a_dist yminterval_unconstrained) return ut_be_within,
member function not_to_be_within_pct(a_dist natural) return ut_be_within_pct
member function not_to_be_within_pct(a_dist number) return ut_be_within_pct
)
not final
/
42 changes: 24 additions & 18 deletions test/ut3_user/expectations/binary/test_to_be_within_pct.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -114,31 +114,31 @@ create or replace package body test_to_be_within_pct is

procedure success_tests is
begin
ut3_develop.ut.expect( 2.987654321 ).to_be_within_pct( 1 ).of_(3);
ut3_develop.ut.expect( 1 ).to_be_within_pct( 0.01 ).of_(1.0001);
expect_success;

ut3_develop.ut.expect( 2.987654321 ).to_( ut3_develop.be_within_pct( 1 ).of_(3) );
ut3_develop.ut.expect( 1.0001 ).to_( ut3_develop.be_within_pct( 0.01 ).of_(1) );
expect_success;

ut3_develop.ut.expect( 2.987654321 ).not_to_be_within_pct( 0.1 ).of_(3);
ut3_develop.ut.expect( 1.0002 ).not_to_be_within_pct( 0.01 ).of_(1);
expect_success;

ut3_develop.ut.expect( 2.987654321 ).not_to( ut3_develop.be_within_pct( 0.1 ).of_(3) );
ut3_develop.ut.expect( 1 ).not_to( ut3_develop.be_within_pct( 0.01 ).of_(1.0002) );
expect_success;

ut3_develop.ut.expect( 3.012345679 ).to_be_within_pct( 1 ).of_(3);
ut3_develop.ut.expect( 1.0001 ).to_be_within_pct( -0.01 ).of_(1);
expect_success;

ut3_develop.ut.expect( 3.012345679 ).to_( ut3_develop.be_within_pct( 1 ).of_(3) );
ut3_develop.ut.expect( 1 ).to_( ut3_develop.be_within_pct( -0.01 ).of_(1.0001) );
expect_success;

ut3_develop.ut.expect( 3.012345679 ).not_to_be_within_pct( 0.1 ).of_(3);
ut3_develop.ut.expect( 1.00000001 ).not_to_be_within_pct( 0 ).of_(1);
expect_success;

ut3_develop.ut.expect( 3.012345679 ).not_to( ut3_develop.be_within_pct( 0.1 ).of_(3) );
ut3_develop.ut.expect( 0 ).not_to( ut3_develop.be_within_pct( 0.01 ).of_(0.000001) );
expect_success;

ut3_develop.ut.expect( 0 ).to_be_within_pct( 10 ).of_( 0 );
ut3_develop.ut.expect( 0 ).to_be_within_pct( 0 ).of_( 0 );
expect_success;

ut3_develop.ut.expect( 0 ).to_be_within_pct( 100 ).of_( 1 );
Expand All @@ -150,31 +150,37 @@ create or replace package body test_to_be_within_pct is

procedure failed_tests is
begin
ut3_develop.ut.expect( 2.987654321 ).to_be_within_pct( 0.1 ).of_(3);
ut3_develop.ut.expect( 1 ).not_to_be_within_pct( 0.01 ).of_(1.0001);
expect_failure;

ut3_develop.ut.expect( 2.987654321 ).to_( ut3_develop.be_within_pct( 0.1 ).of_(3) );
ut3_develop.ut.expect( 1.0001 ).not_to( ut3_develop.be_within_pct( 0.01 ).of_(1) );
expect_failure;

ut3_develop.ut.expect( 2.987654321 ).not_to_be_within_pct( 1 ).of_(3);
ut3_develop.ut.expect( 1.0002 ).to_be_within_pct( 0.01 ).of_(1);
expect_failure;

ut3_develop.ut.expect( 2.987654321 ).not_to( ut3_develop.be_within_pct( 1 ).of_(3) );
ut3_develop.ut.expect( 1 ).to_( ut3_develop.be_within_pct( 0.01 ).of_(1.0002) );
expect_failure;

ut3_develop.ut.expect( 3.012345679 ).to_be_within_pct( 0.1 ).of_(3);
ut3_develop.ut.expect( 1.0001 ).not_to_be_within_pct( -0.01 ).of_(1);
expect_failure;

ut3_develop.ut.expect( 3.012345679 ).to_( ut3_develop.be_within_pct( 0.1 ).of_(3) );
ut3_develop.ut.expect( 1 ).not_to( ut3_develop.be_within_pct( -0.01 ).of_(1.0001) );
expect_failure;

ut3_develop.ut.expect( 3.012345679 ).not_to_be_within_pct( 1 ).of_(3);
ut3_develop.ut.expect( 1.00000001 ).to_be_within_pct( 0 ).of_(1);
expect_failure;

ut3_develop.ut.expect( 3.012345679 ).not_to( ut3_develop.be_within_pct( 1 ).of_(3) );
ut3_develop.ut.expect( 0 ).to_( ut3_develop.be_within_pct( 0.01 ).of_(0.000001) );
expect_failure;

ut3_develop.ut.expect( 0.1 ).to_be_within_pct( 10 ).of_( 0 );
ut3_develop.ut.expect( 0 ).not_to_be_within_pct( 0 ).of_( 0 );
expect_failure;

ut3_develop.ut.expect( 0 ).not_to_be_within_pct( 100 ).of_( 1 );
expect_failure;

ut3_develop.ut.expect( -1 ).not_to_be_within_pct( 200 ).of_( 1 );
expect_failure;
end;

Expand Down