Skip to content

test: add tests and benchmarks for Boolean prototype methods#12112

Draft
Planeshifter wants to merge 3 commits into
developfrom
claude/vibrant-brahmagupta-S8XUe
Draft

test: add tests and benchmarks for Boolean prototype methods#12112
Planeshifter wants to merge 3 commits into
developfrom
claude/vibrant-brahmagupta-S8XUe

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Resolves #1379.

Description

What is the purpose of this pull request?

This pull request:

  • Adds unit tests for Boolean.prototype.toString in test/test.to_string.js
  • Adds unit tests for Boolean.prototype.valueOf in test/test.value_of.js
  • Adds a benchmark for Boolean.prototype.toString in benchmark/benchmark.to_string.js
  • Adds a benchmark for Boolean.prototype.valueOf in benchmark/benchmark.value_of.js

The docs/repl.txt already documents both prototype methods. This PR adds the missing test and benchmark coverage, following the same conventions used in @stdlib/array/bool and @stdlib/array/float32.

Each test file covers:

  1. Property existence on the prototype (hasOwnProp + isFunction)
  2. Wrong-context TypeError (calling the method with a non-Boolean this)
  3. Functional correctness for true and false Boolean objects

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code.


@stdlib-js/reviewers


Generated by Claude Code

claude added 2 commits May 13, 2026 05:30
…Boolean.prototype.valueOf`

Adds unit tests and benchmarks for the `toString` and `valueOf` prototype methods of the `@stdlib/boolean/ctor` package, following the same conventions as similar typed array packages.

Closes #1379

https://claude.ai/code/session_016rDdCHYDzUT1T7YaRAA21G
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
boolean/ctor $\color{green}103/103$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}0/0$
$\color{green}+100.00%$
$\color{green}103/103$
$\color{green}+100.00%$

The above coverage report was generated for the changes in this PR.

Copy link
Copy Markdown
Member Author

⚠️ Issue Reference Review

An automated check found potentially unrelated issue/PR references in this PR:

Reference Assessment Reasoning
#1379 suspicious PR #12112 adds tests/benchmarks for Boolean prototype methods, but #1379 is an automated "docs: update list of contributors" PR with no connection to Boolean or prototype method testing. The Resolves keyword would normally auto-close the referenced item on merge. This may be an accidental reference — possibly intended to point to an issue in a different repository (e.g. stdlib-js/todo#1379).

Why this matters: GitHub automatically closes issues referenced with closing keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect references can accidentally close unrelated issues.

What to do:

  • If the reference is correct, no action needed. This check may produce false positives.
  • If the reference is incorrect, please update your PR description.

This assessment was generated by an AI model and is informational only.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants