MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/dataset/file_test.cc:64–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62using testing::ContainerEq;
63
64TEST(FileSource, PathBased) {
65 auto localfs = std::make_shared<fs::LocalFileSystem>();
66
67 std::string p1 = "/path/to/file.ext";
68 std::string p2 = "/path/to/file.ext.gz";
69
70 FileSource source1(p1, localfs);
71 FileSource source2(p2, localfs, Compression::GZIP);
72
73 ASSERT_EQ(p1, source1.path());
74 ASSERT_TRUE(localfs->Equals(*source1.filesystem()));
75 ASSERT_EQ(Compression::UNCOMPRESSED, source1.compression());
76
77 ASSERT_EQ(p2, source2.path());
78 ASSERT_TRUE(localfs->Equals(*source2.filesystem()));
79 ASSERT_EQ(Compression::GZIP, source2.compression());
80
81 // Test copy constructor and comparison
82 FileSource source3;
83 source3 = source1;
84 ASSERT_EQ(source1.path(), source3.path());
85 ASSERT_EQ(source1.filesystem(), source3.filesystem());
86}
87
88TEST(FileSource, BufferBased) {
89 std::string the_data = "this is the file contents";

Callers

nothing calls this directly

Calls 7

filesystemMethod · 0.80
pathMethod · 0.45
EqualsMethod · 0.45
compressionMethod · 0.45
bufferMethod · 0.45
sizeMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected