Skip to content

Commit 16ec00f

Browse files
committed
Do not use asserts to pass bootstrapped tests
1 parent a995e3a commit 16ec00f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/run-with-compiler/shonan-hmm-simple.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Complex(4,3)
66
10
77

88
((arr1: scala.Array[scala.Int], arr2: scala.Array[scala.Int]) => {
9-
dotty.DottyPredef.assert(arr1.length.==(arr2.length))
9+
if (arr1.length.!=(arr2.length)) throw new scala.Exception("...") else ()
1010
var sum: scala.Int = 0
1111
var i: scala.Int = 0
1212
while (i.<(scala.Predef.intArrayOps(arr1).size)) {
@@ -21,13 +21,13 @@ Complex(4,3)
2121
10
2222

2323
((arr: scala.Array[scala.Int]) => {
24-
dotty.DottyPredef.assert(arr.length.==(5))
24+
if (arr.length.!=(5)) throw new scala.Exception("...") else ()
2525
arr.apply(0).+(arr.apply(2)).+(arr.apply(4))
2626
})
2727
10
2828

2929
((arr: scala.Array[Complex[scala.Int]]) => {
30-
dotty.DottyPredef.assert(arr.length.==(4))
30+
if (arr.length.!=(4)) throw new scala.Exception("...") else ()
3131
Complex.apply[scala.Int](0.-(arr.apply(0).im).+(0.-(arr.apply(2).im)).+(arr.apply(3).re.*(2)), arr.apply(0).re.+(arr.apply(2).re).+(arr.apply(3).im.*(2)))
3232
})
3333
Complex(4,3)

tests/run-with-compiler/shonan-hmm-simple.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ object Test {
153153
val blasExprIntExpr = new Blas1(new RingIntExpr, new ExprVecOps)
154154
val resCode2: Expr[(Array[Int], Array[Int]) => Int] = '{
155155
(arr1, arr2) =>
156-
assert(arr1.length == arr2.length)
156+
if (arr1.length != arr2.length) throw new Exception("...")
157157
~{
158158
blasExprIntExpr.dot(
159159
new Vec('(arr1.size), i => '(arr1(~i))),
@@ -177,7 +177,7 @@ object Test {
177177
val blasExprIntPVExpr = new Blas1(new RingPV[Int](new RingInt, new RingIntExpr), new StaticVecOps)
178178
val resCode4: Expr[Array[Int] => Int] = '{
179179
arr =>
180-
assert(arr.length == ~vec2.size.toExpr)
180+
if (arr.length != ~vec2.size.toExpr) throw new Exception("...")
181181
~{
182182
blasExprIntPVExpr.dot(
183183
new Vec(vec2.size, i => Dyn('(arr(~i.toExpr)))),
@@ -194,7 +194,7 @@ object Test {
194194
val blasExprComplexPVInt = new Blas1[Int, Complex[PV[Int]]](new RingComplex(new RingPV[Int](new RingInt, new RingIntExpr)), new StaticVecOps)
195195
val resCode5: Expr[Array[Complex[Int]] => Complex[Int]] = '{
196196
arr =>
197-
assert(arr.length == ~cmpxVec2.size.toExpr)
197+
if (arr.length != ~cmpxVec2.size.toExpr) throw new Exception("...")
198198
~{
199199
val cpx = blasExprComplexPVInt.dot(
200200
new Vec(cmpxVec2.size, i => Complex(Dyn('(arr(~i.toExpr).re)), Dyn('(arr(~i.toExpr).im)))),

0 commit comments

Comments
 (0)