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

Add assert_is() and assert_is_not() #34

Merged
merged 3 commits into from
Mar 11, 2024
Merged

Conversation

fantix
Copy link
Contributor

@fantix fantix commented Mar 9, 2024

We should probably introduce a !== operator ... ?

Comment on lines +74 to +120
if a === b {
Ok(())
} else {
let a = debug_string(a)
let b = debug_string(b)
Err("assertion failed for `\(a) === \(b)`")
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is preferably @option.unless(a === b, fn() { ... }), but crippled by the lack of test_import in moon.pkg.json, and/or a better handling of cyclic dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_import will be added as soon as next week

@fantix fantix mentioned this pull request Mar 9, 2024
3 tasks
Copy link
Collaborator

@Yoorkin Yoorkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution!

@lijunchen lijunchen merged commit 6b430ec into moonbitlang:main Mar 11, 2024
3 checks passed
@fantix fantix deleted the assert_is branch March 11, 2024 12:34
@fantix
Copy link
Contributor Author

fantix commented Mar 11, 2024

Embarassingly, === is just deprecated:

=== has been deprecated; please use physical_equal as its replacement.

I'll follow up with another PR after working hours.

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.

None yet

3 participants