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

test: replace internal API test with public API test #30742

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Nov 30, 2019

The internal freelist hasItems() test use the internal API directly.
This commit changes them to use the API as it is exposed publicly. It
tests the same code paths, but does it without needing
--expose-internals.

Refs: #27588 (review)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

The internal freelist `hasItems()` test use the internal API directly.
This commit changes them to use the API as it is exposed publicly. It
tests the same code paths, but does it without needing
`--expose-internals`.

Refs: nodejs#27588 (review)
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 30, 2019
addaleax
addaleax previously approved these changes Nov 30, 2019
assert.strictEqual(flist2.hasItems(), true);

flist2.alloc();
assert.strictEqual(flist2.hasItems(), false);
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep this? The additions below also aren’t public API, so it’s not really guaranteed that they keep testing this here.

@addaleax
Copy link
Member

Actually, sorry, but scrap my review. This doesn’t really improve things beyond making another internal API “more official” by testing it.

@addaleax addaleax dismissed their stale review November 30, 2019 23:00

too fast

@Trott
Copy link
Member Author

Trott commented Nov 30, 2019

Actually, sorry, but scrap my review. This doesn’t really improve things beyond making another internal API “more official” by testing it.

Would you be on board with removing hasItems entirely since we don't use it?

If yes, cool, we can do that in a semver-major.

If no, then we're basically supporting public use of this API indefinitely anyway, so I'd be inclined to test the public-facing exposure of it. (At least, that was my thinking when opening this PR!)

@addaleax
Copy link
Member

Sure, I’m good with removing it 👍

@Trott Trott closed this Dec 1, 2019
@Trott Trott deleted the publicize branch April 14, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants