Skip to content

Commit f4a706e

Browse files
committed
Portable function lookup test
1 parent 2cdf910 commit f4a706e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/substrait/function/tests/FunctionLookupTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <gtest/gtest.h>
44

5+
#include <filesystem>
56
#include <iostream>
67

78
#include "substrait/function/FunctionLookup.h"
@@ -12,9 +13,10 @@ class FunctionLookupTest : public ::testing::Test {
1213
protected:
1314
static std::string getExtensionAbsolutePath() {
1415
const std::string absolutePath = __FILE__;
15-
auto const pos = absolutePath.find_last_of('/');
16-
return absolutePath.substr(0, pos) +
17-
"/../../../../third_party/substrait/extensions/";
16+
std::filesystem::path path(absolutePath);
17+
std::filesystem::path parentDir = path.parent_path();
18+
return (parentDir / "../../../../third_party/substrait/extensions/")
19+
.string();
1820
}
1921

2022
void SetUp() override {

0 commit comments

Comments
 (0)