Advertisement
JadonChan

TestCases.cpp

Mar 21st, 2025
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.35 KB | None | 0 0
  1. #include "gtest/gtest.h"
  2. #include "../solution.h"
  3.  
  4. TEST(Test, Sample1) {
  5.     solution sol;
  6.     std::vector<int> input{16, 16, 17};
  7.     std::vector<int> expected{17, 17, -1};
  8.     auto output = sol.minimal_larger_suffix(input);
  9.     EXPECT_EQ(output, expected);
  10. }
  11.  
  12. TEST(Test, Sample2) {
  13.     solution sol;
  14.     std::vector<int> input{12, 13, 11, 15, 15, 17, 16, 15, 19};
  15.     std::vector<int> expected{13, 15, 15, 16, 16, 19, 19, 19, -1};
  16.     auto output = sol.minimal_larger_suffix(input);
  17.     EXPECT_EQ(output, expected);
  18. }
  19.  
  20. TEST(Test, Sample3) {
  21.     solution sol;
  22.     std::vector<int> input{1, 2, 3, 4, 5, 6, 7, 8};
  23.     std::vector<int> expected{2, 3, 4, 5, 6, 7, 8, -1};
  24.     auto output = sol.minimal_larger_suffix(input);
  25.     EXPECT_EQ(output, expected);
  26. }
  27.  
  28. TEST(Test, Sample4) {
  29.     solution sol;
  30.     std::vector<int> input{8, 7, 6, 5, 4, 3, 2, 1};
  31.     std::vector<int> expected{-1, -1, -1, -1, -1, -1, -1, -1};
  32.     auto output = sol.minimal_larger_suffix(input);
  33.     EXPECT_EQ(output, expected);
  34. }
  35.  
  36. TEST(Test, Sample5) {
  37.     solution sol;
  38.     std::vector<int> input{};
  39.     std::vector<int> expected{};
  40.     auto output = sol.minimal_larger_suffix(input);
  41.     EXPECT_EQ(output, expected);
  42. }
  43.  
  44. TEST(Test, Sample6) {
  45.     solution sol;
  46.     std::vector<int> input{1, 1, 1, 1, 1, 1, 1};
  47.     std::vector<int> expected{-1, -1, -1, -1, -1, -1, -1};
  48.     auto output = sol.minimal_larger_suffix(input);
  49.     EXPECT_EQ(output, expected);
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement