testng-team / testng-team/testng-asserts

Type mismatch silent ignored

Open
#13 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

TestNG Version

7.4.0

Assert.assertNotEquals(0L, 0);
or a mehot returning long (primitive):
Assert.assertNotEquals(longMethod(), 0);

Expected behavior

AssertionError

Actual behavior

No error, silent assertion mismatch.
Values are compared as Objects, so Long != Integer.

Is the issue reproductible on runner?
  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans
Test case sample

https://github.com/cdalexndr/testng-issue-2561

Oddly, If I add the above test into the testng main repo project test, the test works.
It may also be compiler dependent.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the Gradle reproduction and the linked test case sample, then trace the Assert.assertNotEquals(longMethod(), 0) call path. Verify the behavior for the two examples and add a regression test that expects AssertionError for the type mismatch, including any compiler-dependent behavior observed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.