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

Function TEST

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

Source from the content-addressed store, hash-verified

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