Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/pm resolve #4

Merged
merged 9 commits into from
Nov 16, 2023
Merged

Conversation

Ceres6
Copy link
Collaborator

@Ceres6 Ceres6 commented Oct 23, 2023

No description provided.

@@ -647,6 +647,19 @@ RAIIIsolate::~RAIIIsolate() {
isolate_->Dispose();
}

#ifdef _WIN32
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need it. We have a node::kPathSeparator so you can just compare if (c == node::kPathSeparator)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I saw in JS implementation for windows we accept both forward and back slash separator. Does node::kPathSeparator accept both or is one of them not needed?

Copy link
Owner

@RafaelGSS RafaelGSS Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node::kPathSeparator is chosen based on the platform, so yes.

@@ -25,6 +25,6 @@ const { spawnSync } = require('child_process');
);

const [fsWrite] = stdout.toString().split('\n');
assert.strictEqual(fsWrite, 'false');
assert.strictEqual(fsWrite, 'true');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test the absolute file too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test file added

TEST(UtilTest, PathResolve) {
#ifdef _WIN32
// TODO: figure out how to get env
EXPECT_EQ(PathResolve(nullptr, {"c:/blah\\blah", "d:/games", "c:../a"}),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be the same as POSIX platforms?

  v8::HandleScope handle_scope(isolate_);
  Argv argv;
  Env env{handle_scope, argv};

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was waiting to make it work

@@ -253,7 +258,7 @@ TEST(UtilTest, MaybeStackBuffer) {
}
}

TEST(UtilTest, SPrintF) {
TEST_F(UtilTest, SPrintF) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to change the others to TEST_F? Wouldn't it be just adding a new test with TEST_F?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't let you mix both in the same file. I could create a new file but that didn't seem coherent

@RafaelGSS RafaelGSS merged commit 33e97b3 into RafaelGSS:feat/pm-resolve Nov 16, 2023
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants