Skip to content

Commit

Permalink
reformat 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei Pang authored and Wei Pang committed Jan 13, 2023
1 parent 3dd60a9 commit e535966
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
30 changes: 14 additions & 16 deletions test/copy/copy_fault_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class CopyRelTableMultiplicityViolationTest : public CopyFaultTest {

TEST_F(CopyDuplicateIDTest, DuplicateIDsError) {
validateCopyException(
"COPY person FROM \"" + TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/duplicate-ids/vPerson.csv\""),
"COPY person FROM \"" +
TestHelper::appendKuzuRootPath("dataset/copy-fault-tests/duplicate-ids/vPerson.csv\""),
"Copy exception: " + Exception::getExistedPKExceptionMsg("10"));
}

Expand Down Expand Up @@ -70,11 +70,10 @@ TEST_F(CopyWrongHeaderTest, HeaderError) {
"(HEADER=true)"));
// We assert that headers are ignored, so any mistakes there won't cause an error
ASSERT_TRUE(result->isSuccess());
result =
conn->query("COPY knows FROM \"" +
TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/eKnowsWrongColumnName.csv\" "
"(HEADER=true)"));
result = conn->query("COPY knows FROM \"" +
TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/eKnowsWrongColumnName.csv\" "
"(HEADER=true)"));
ASSERT_TRUE(result->isSuccess());
}

Expand All @@ -86,11 +85,10 @@ TEST_F(CopyWrongHeaderTest, CopyToNonEmptyTableErrors) {
"dataset/copy-fault-tests/wrong-header/vPersonWrongColumnName.csv\""
"(HEADER=true)"));
ASSERT_TRUE(result->isSuccess());
result =
conn->query("COPY person FROM \"" +
TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/vPersonWrongColumnName.csv\" "
"(HEADER=true)"));
result = conn->query("COPY person FROM \"" +
TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/vPersonWrongColumnName.csv\" "
"(HEADER=true)"));
ASSERT_FALSE(result->isSuccess());
}

Expand All @@ -105,10 +103,10 @@ TEST_F(CopyWrongHeaderTest, MissingColumnErrors) {
TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/vPerson.csv\" (HEADER=true)"));
ASSERT_TRUE(result->isSuccess());
result = conn->query("COPY knows FROM \"" +
TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/eKnowsMissingColumn.csv\""
"(HEADER=true)"));
result = conn->query(
"COPY knows FROM \"" + TestHelper::appendKuzuRootPath(
"dataset/copy-fault-tests/wrong-header/eKnowsMissingColumn.csv\""
"(HEADER=true)"));
ASSERT_FALSE(result->isSuccess());
}

Expand Down
3 changes: 1 addition & 2 deletions test/copy/copy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ TEST_F(CopyNodePropertyTest, NodeStructuredStringPropertyTest) {
auto propertyIdx = catalog->getReadOnlyVersion()->getNodeProperty(tableID, "randomString");
auto column = reinterpret_cast<StringPropertyColumn*>(
graph->getNodesStore().getNodePropertyColumn(tableID, propertyIdx.propertyID));
string fName =
TestHelper::appendKuzuRootPath("dataset/copy-node-property-test/vPerson.csv");
string fName = TestHelper::appendKuzuRootPath("dataset/copy-node-property-test/vPerson.csv");
ReaderConfig config;
CSVReader csvReader(fName, config);
int lineIdx = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper/test_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void BaseGraphTest::initGraph() {
TestHelper::executeCypherScript(getInputDir() + TestHelper::COPY_CSV_FILE_NAME, *conn);
}

void BaseGraphTest::initGraphFromPath(const string &path) const {
void BaseGraphTest::initGraphFromPath(const string& path) const {
TestHelper::executeCypherScript(path + TestHelper::SCHEMA_FILE_NAME, *conn);
TestHelper::executeCypherScript(path + TestHelper::COPY_CSV_FILE_NAME, *conn);
}
Expand Down

0 comments on commit e535966

Please sign in to comment.