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

Function Y_UNIT_TEST

util/stream/file_ut.cpp:12–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11Y_UNIT_TEST_SUITE(TFileTest) {
12 Y_UNIT_TEST(InputTest) {
13 TTempFile tmp(TmpFileName);
14
15 {
16 TUnbufferedFileOutput output(TmpFileName);
17 output.Write(TmpFileContents, strlen(TmpFileContents));
18 }
19
20 {
21 TUnbufferedFileInput input(TmpFileName);
22 TString s = input.ReadAll();
23 UNIT_ASSERT_VALUES_EQUAL(s, TmpFileContents);
24 }
25
26 {
27 TUnbufferedFileInput input(TmpFileName);
28 input.Skip(TmpFileSubstring - TmpFileContents);
29 TString s = input.ReadAll();
30 UNIT_ASSERT_VALUES_EQUAL(s, "chivalrous plan");
31 }
32
33 {
34 TUnbufferedFileOutput output(TFile::ForAppend(TmpFileName));
35 output.Write(TmpFileContents, strlen(TmpFileContents));
36 }
37
38 {
39 TUnbufferedFileInput input(TmpFileName);
40 TString s = input.ReadAll();
41 UNIT_ASSERT_VALUES_EQUAL(s, TString::Join(TmpFileContents, TmpFileContents));
42 }
43 }
44
45 Y_UNIT_TEST(EmptyMapTest) {
46 TTempFile tmp(TmpFileName);

Callers

nothing calls this directly

Calls 8

ReadAllMethod · 0.80
JoinFunction · 0.50
writeFunction · 0.50
closeFunction · 0.50
WriteMethod · 0.45
SkipMethod · 0.45
emptyMethod · 0.45
ReadLineMethod · 0.45

Tested by

no test coverage detected