question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ShouldNotBeTrueInspection` false positive

See original GitHub issue

Kotest: 4.6.1

Repro steps:

Given following code:

	val someVariable: Boolean? = null
	someVariable shouldNotBe true

IDE shows a warning and suggests a replacement that will fail the test image

Use-case

In my specific case I want to verify if google’s LiveData instance doesn’t have specific value. I don’t care if it is false or null - I consider that an implementation detail. I assumed making an shouldNotBe true is a valid way of checking that but IDE shows a warning with an invalid fix hence this issue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sksamuelcommented, Oct 11, 2021

So yeah I would just remove it and we can play with the types for the shouldBe analysis.

1reaction
sksamuelcommented, Oct 11, 2021

@Kantis we talked about just removing this inspection.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The “false positive paradox” and why we shouldn't test ...
It's a paradox because even quite accurate tests can lead to high levels of false positives when used widely in a population with...
Read more >
6 reasons why you shouldn't get an inspection done by ...
Reason #2: They might cause significant damage to your dream home ... A home inspection is a non-invasive process and the home has...
Read more >
At-Home COVID Test Accuracy: What to Know About Negative ...
One popular test misses around 15 out of 100 infections — these are called “false negatives” — and gives a false positive result...
Read more >
Collection of false positives for inspection: "Assignment is not ...
I recently upgraded from 2.3.1.4441 to 2.4.0.4488 and I'm reasonably confident that these false positives haven't been showing up before the ...
Read more >
Spotlight on security: The Curse of the False Positive
Obviously, a false negative/missed detection matters. How much it matters depends on quite a few factors, such as how widespread the real but ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found