@@ -6,13 +6,17 @@ function assert(cond, message) {
66
77function assertEq ( lhs , rhs , message ) {
88 if ( lhs !== rhs ) {
9- throw `AssertionError: ${ message ? message + ", " : "" } expected ${ JSON . stringify ( rhs ) } , actual ${ JSON . stringify ( lhs ) } ` ;
9+ throw `AssertionError: ${
10+ message ? message + ", " : ""
11+ } expected ${ JSON . stringify ( rhs ) } , actual ${ JSON . stringify ( lhs ) } `;
1012 }
1113}
1214
1315function assertNEq ( lhs , rhs , message ) {
1416 if ( lhs === rhs ) {
15- throw `AssertionError: ${ message ? message + ", " : "" } expected ${ JSON . stringify ( rhs ) } , actual ${ JSON . stringify ( lhs ) } ` ;
17+ throw `AssertionError: ${
18+ message ? message + ", " : ""
19+ } expected ${ JSON . stringify ( rhs ) } , actual ${ JSON . stringify ( lhs ) } `;
1620 }
1721}
1822
@@ -26,7 +30,9 @@ function assertArrayEqual(lhs, rhs, message) {
2630 try {
2731 l = [ ...lhs ] ;
2832 } catch ( e ) {
29- throw `AssertionError: ${ message ? message + ", " : "" } expected an iterable, actual isn't.` ;
33+ throw `AssertionError: ${
34+ message ? message + ", " : ""
35+ } expected an iterable, actual isn't.`;
3036 }
3137 const r = [ ...rhs ] ;
3238
@@ -37,7 +43,9 @@ function assertArrayEqual(lhs, rhs, message) {
3743 return ;
3844 }
3945
40- throw `AssertionError: ${ message ? message + ", " : "" } expected ${ JSON . stringify ( rhs ) } , actual ${ JSON . stringify ( lhs ) } ` ;
46+ throw `AssertionError: ${
47+ message ? message + ", " : ""
48+ } expected ${ JSON . stringify ( rhs ) } , actual ${ JSON . stringify ( lhs ) } `;
4149}
4250
4351function assertThrows ( fn , message ) {
@@ -46,5 +54,7 @@ function assertThrows(fn, message) {
4654 } catch ( e ) {
4755 return ;
4856 }
49- throw `AssertionError: ${ message ? message + ", " : "" } function did not throw.` ;
57+ throw `AssertionError: ${
58+ message ? message + ", " : ""
59+ } function did not throw.`;
5060}
0 commit comments