From 0ab2d1cc21e003689f519b0ddae2cedca24a5785 Mon Sep 17 00:00:00 2001 From: JoelGunawan Date: Sat, 12 Oct 2024 23:18:05 -0700 Subject: [PATCH] added elementsAreNonDescending() validator test --- test/unit/tcframe/validator/VectorValidatorTests.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/tcframe/validator/VectorValidatorTests.cpp b/test/unit/tcframe/validator/VectorValidatorTests.cpp index fbe8da5..612b8fd 100644 --- a/test/unit/tcframe/validator/VectorValidatorTests.cpp +++ b/test/unit/tcframe/validator/VectorValidatorTests.cpp @@ -17,4 +17,12 @@ TEST_F(VectorValidatorTests, eachElementIsBetween) { EXPECT_TRUE(eachElementIsBetween(vector{2, 3, 1, 5, 4}, 0, 6)); } +TEST_F(VectorValidatorTests, elementsAreNonDescending) { + EXPECT_FALSE(elementsAreNonDescending(vector{1, 2, 3, 5, 3})); + EXPECT_FALSE(elementsAreNonDescending(vector{2, 1, 1, 2, 5})); + EXPECT_TRUE(elementsAreNonDescending(vector())); + EXPECT_TRUE(elementsAreNonDescending(vector{1, 2, 3, 4, 5})); + EXPECT_TRUE(elementsAreNonDescending(vector{1, 1, 2, 3, 3, 7})); +} + }