Skip to content

Commit

Permalink
Shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Feb 17, 2018
1 parent 8bee5d2 commit 3f188cf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,21 @@ function testEq(exprIn, expect) {
it(`${expr} => ${show(expect)}`, () => {
const actual = run(expr)
if (!equals(actual, expect))
throw new Error(`Expected: ${show(expect)}, actual: ${show(actual)}`)
throw Error(`Expected: ${show(expect)}, actual: ${show(actual)}`)

toggleEnv()
try {
const actual = run(expr)
if (!equals(actual, expect))
throw new Error(`Expected: ${show(expect)}, actual: ${show(actual)}`)
throw Error(`Expected: ${show(expect)}, actual: ${show(actual)}`)
} finally {
toggleEnv()
}

const exprTy = expr.replace(/\bL\.([a-zA-Z0-9]*)/g, 'T.$1(L.$1)')
const typed = run(exprTy)
if (!equals(actual, typed))
throw new Error(`Typed: ${show(typed)}, actual: ${show(actual)}`)
throw Error(`Typed: ${show(typed)}, actual: ${show(actual)}`)
})
}

Expand All @@ -172,7 +172,7 @@ const testThrows = expr =>
raised = true
}
if (!raised)
throw new Error(`Expected ${expr} to throw, returned ${show(result)}`)
throw Error(`Expected ${expr} to throw, returned ${show(result)}`)
})

const empties = [undefined, null, false, true, '', 0, 0.0 / 0.0, {}, []]
Expand Down Expand Up @@ -1174,7 +1174,7 @@ describe('BST', () => {
let key

const error = () => {
throw new Error(
throw Error(
'From ' +
show(before) +
' ' +
Expand Down

0 comments on commit 3f188cf

Please sign in to comment.