mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 16:55:11 +01:00
Prove "assert true".
This commit is contained in:
1 parent
c736c1c509
commit
d3eba13223
2 files changed
+7
-1
No files matched your search
@@ -56,7 +56,11 @@ func (q *checker) bcheckStatement(n *a.Node) error {
|
|||||||
n := n.Assert()
|
n := n.Assert()
|
||||||
condition := n.Condition()
|
condition := n.Condition()
|
||||||
err := errFailed
|
err := errFailed
|
||||||
if reasonID := n.Reason(); reasonID != 0 {
|
if cv := condition.ConstValue(); cv != nil {
|
||||||
|
if cv.Cmp(one) == 0 {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
} else if reasonID := n.Reason(); reasonID != 0 {
|
||||||
if reasonFunc := q.reasonMap[reasonID.Key()]; reasonFunc != nil {
|
if reasonFunc := q.reasonMap[reasonID.Key()]; reasonFunc != nil {
|
||||||
err = reasonFunc(q, n)
|
err = reasonFunc(q, n)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ func TestCheck(t *testing.T) {
|
|||||||
var p i32
|
var p i32
|
||||||
var q i32[0:8]
|
var q i32[0:8]
|
||||||
|
|
||||||
|
assert true
|
||||||
|
|
||||||
while p == q,
|
while p == q,
|
||||||
post p != q,
|
post p != q,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user