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

ASSERT copies only 3 values for failed expression, also flaky #2231

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 1 comment
Closed

ASSERT copies only 3 values for failed expression, also flaky #2231

Siskin-Bot opened this issue Feb 15, 2020 · 1 comment
Labels

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: fork

If an assertion fails, the resulting error message attempts to capture the failing expression that it detected. For some reason it only takes up to 3 elements of that expression.

>> assert [true 1 + 3 = 2 true]
** Script error: assertion failed for: [1 + 3] ; <-- HERE
** Where: assert
** Near: assert [true 1 + 3 = 2 true]

Additionally: because it only copies the expression out after running the assert, it can fail to capture an expression correctly if it modifies the block:

>> conditions: [true true (clear conditions false) true]
== [true true (clear conditions false) true]
>> assert conditions
** Script error: assertion failed for: []
** Where: assert
** Near: assert conditions

Imported from: CureCode [ Version: r3 master Type: Bug Platform: All Category: Unspecified Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#2231

Comments:


Rebolbot added the Type.bug on Jan 12, 2016


Ladislav commented on Feb 7, 2016:

I never used ASSERT, and I do not want to change this habit. I do understand that this property is a disadvantage, but I do not think this can be corrected easily, and it can certainly be circumvented without much hassle.


@Oldes Oldes added Oldes.resolved Bugs/wishes with Oldes' fixes/features Test.written labels Dec 9, 2020
@Oldes
Copy link
Owner

Oldes commented Dec 9, 2020

I fixed the first part, ignoring the second one as I think that one is not supposed to do stupid things in assert conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants