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

Value not shown when calling function in #expect #606

Closed
JetForMe opened this issue Aug 8, 2024 · 3 comments
Closed

Value not shown when calling function in #expect #606

JetForMe opened this issue Aug 8, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@JetForMe
Copy link

JetForMe commented Aug 8, 2024

Description

When the following expectation fails:

let sample = try tile.sample(atX: 0, y: 0)
#expect(sample.isApproximatelyEqual(to: 10.276871, absoluteTolerance: 0.0001))

the message printed is

Expectation failed: (sample → 455.85916).isApproximatelyEqual(to: 10.276871, absoluteTolerance: 0.0001)

But if the expectation is written like this:

#expect(try tile.sample(atX: 0, y: 0).isApproximatelyEqual(to: 10.276871, absoluteTolerance: 0.0001))

The message doesn't include the value:

Expectation failed: try tile.sample(atX: 0, y: 0).isApproximatelyEqual(to: 10.276871, absoluteTolerance: 0.0001)

Would be nice if it showed the value in that case too.

Expected behavior

Show the value regardless of the expression.

Actual behavior

No response

Steps to reproduce

No response

swift-testing version/commit hash

a62bf99

Swift & OS version (output of swift --version ; uname -a)

% swift --version ; uname -a
swift-driver version: 1.113 Apple Swift version 6.0 (swiftlang-6.0.0.7.6 clang-1600.0.24.1)
Target: arm64-apple-macosx14.0
Darwin eclipsem1.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
@JetForMe JetForMe added the bug Something isn't working label Aug 8, 2024
@grynspan
Copy link
Contributor

grynspan commented Aug 8, 2024

Duplicate of #162

@grynspan grynspan marked this as a duplicate of #162 Aug 8, 2024
@grynspan grynspan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
@JetForMe
Copy link
Author

JetForMe commented Aug 8, 2024

Oh sorry! I guess I didn't look closely at that, since it was for an async variant.

@grynspan
Copy link
Contributor

grynspan commented Aug 8, 2024

No sorry needed. Duplicate issues aren't a bad thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants