You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It looks like assert!() builtin is not working when it is used in Procs.
Recently, the constructs similar to:
if (false_predicate) {
fail!();
} else {
}
became discouraged in favor of assert!(). The toolchain generates a warning when such construct is detected and advises to switch to assert!().
During the work on #1315, after we converted some of the fail!() to assert!() we noticed that those are no longer triggered in our DSLX tests.
We see that assert!() is tested thoroughly in the context of DSLX functions, but there is no test in the context of a Proc.
I've put up a negative test case that reproduces our problem. It consists of a simple passthrough proc and a test proc. In the body of next() there's an assert!() with a false predicate that should always trigger an Interpreter failure just as it is done when we switch the assert to fail!().
This PR adds a simple proc that forwards the received information from an input channel to an output channel. We found this particular proc surprisingly useful when testing various tools within the toolchain or when reporting bugs.
We used it in:
* #1415
* #1410
* #1392
* #1057
COPYBARA_INTEGRATE_REVIEW=#1416 from antmicro:passthrough 907a62b
PiperOrigin-RevId: 636954688
Describe the bug
It looks like
assert!()
builtin is not working when it is used in Procs.Recently, the constructs similar to:
became discouraged in favor of
assert!()
. The toolchain generates a warning when such construct is detected and advises to switch toassert!()
.During the work on #1315, after we converted some of the
fail!()
toassert!()
we noticed that those are no longer triggered in our DSLX tests.We see that
assert!()
is tested thoroughly in the context of DSLX functions, but there is no test in the context of a Proc.I've put up a negative test case that reproduces our problem. It consists of a simple passthrough proc and a test proc. In the body of
next()
there's anassert!()
with a false predicate that should always trigger an Interpreter failure just as it is done when we switch the assert tofail!()
.To Reproduce
Steps to reproduce the behavior:
assert_in_proc_diff.txt
assert_with_false_predicate_proc.x
test proc finishing successfully without triggering theassert!()
Expected behavior
DSLX Interpreter should report failure when encountering
assert!()
with false predicate in all occurrences.Additional context
Test case for reproducing the issue is available on branch: antmicro/assert-in-proc
The text was updated successfully, but these errors were encountered: