AlexSSH

Untitled

Feb 17th, 2023
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. void TestMatching() {
  2.     const int doc_id = 42;
  3.     const string content = "cat in the city"s;
  4.     const vector<int> ratings = {1, 2, 3};
  5.  
  6.     // находит нужный документ
  7.     {
  8.         SearchServer server;
  9.         server.AddDocument(doc_id, content, DocumentStatus::ACTUAL, ratings);
  10.         const auto [words, status] = server.MatchDocument("in", 42);
  11.         ASSERT(status == DocumentStatus::ACTUAL);
  12.         ASSERT_EQUAL(words.size(), 1);
  13.         ASSERT_EQUAL(words[0], "in");
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment