MCPcopy Create free account
hub / github.com/catboost/catboost / TestPrefix

Method TestPrefix

util/folder/filelist_ut.cpp:33–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void TFileListTest::TestPrefix() {
34 TTempDir tempDir("nonexistingdir");
35 TFile((tempDir() + LOCSLASH_S "good_file1").data(), CreateAlways);
36 TFile((tempDir() + LOCSLASH_S "good_file2").data(), CreateAlways);
37 TFile((tempDir() + LOCSLASH_S "bad_file1").data(), CreateAlways);
38 TFile((tempDir() + LOCSLASH_S "bad_file2").data(), CreateAlways);
39
40 const bool SORT = true;
41 TFileList fileList;
42 {
43 fileList.Fill(tempDir().data(), "good_file", SORT);
44 UNIT_ASSERT_EQUAL(TString(fileList.Next()), "good_file1");
45 UNIT_ASSERT_EQUAL(TString(fileList.Next()), "good_file2");
46 UNIT_ASSERT_EQUAL(fileList.Next(), nullptr);
47 }
48 {
49 fileList.Fill(tempDir().data(), "bad_file", SORT);
50 UNIT_ASSERT_EQUAL(TString(fileList.Next()), "bad_file1");
51 UNIT_ASSERT_EQUAL(TString(fileList.Next()), "bad_file2");
52 UNIT_ASSERT_EQUAL(fileList.Next(), nullptr);
53 }
54}
55
56UNIT_TEST_SUITE_REGISTRATION(TFileListTest);

Callers

nothing calls this directly

Calls 4

TFileClass · 0.50
dataMethod · 0.45
FillMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected