Skip to content

Commit

Permalink
added elementsAreNonDescending() validator test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelGunawan committed Oct 13, 2024
1 parent 2161c64 commit 0ab2d1c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/tcframe/validator/VectorValidatorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ TEST_F(VectorValidatorTests, eachElementIsBetween) {
EXPECT_TRUE(eachElementIsBetween(vector<int>{2, 3, 1, 5, 4}, 0, 6));
}

TEST_F(VectorValidatorTests, elementsAreNonDescending) {
EXPECT_FALSE(elementsAreNonDescending(vector<int>{1, 2, 3, 5, 3}));
EXPECT_FALSE(elementsAreNonDescending(vector<int>{2, 1, 1, 2, 5}));
EXPECT_TRUE(elementsAreNonDescending(vector<int>()));
EXPECT_TRUE(elementsAreNonDescending(vector<int>{1, 2, 3, 4, 5}));
EXPECT_TRUE(elementsAreNonDescending(vector<int>{1, 1, 2, 3, 3, 7}));
}

}

0 comments on commit 0ab2d1c

Please sign in to comment.