microsoft / microsoft/VFSForGit

Update tests to use XCTAssertEqual instead of XCTAssertTrue where appropriate

Open
#1,170 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects: tests domain: kext platform: macOS
Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

From @pmj in a conversation regarding a failed test:

Note that this case illustrates why using XCTAssertEqual over XCTAssertTrue is to be preferred – XCTAssertEqual prints the values that failed the comparison. So we could have had a bit more detail on the nature of the test failures. It may be worth converting the asserts in testShouldHandleFileOpEvent to their respective diagnostic-outputting equivalent – I see a lot of XCTAssertTrue() with == inside.

Contributor guide

Open the contributing guide

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

Locate the test named testShouldHandleFileOpEvent and inspect its XCTAssertTrue assertions that compare values with ==. Replace the applicable assertions with their diagnostic-outputting equivalent, then run the relevant test to confirm it still passes and reports comparison values on failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.