@@ -5,9 +5,9 @@ import { Verdict } from "..";
5
5
6
6
export class Expectation < T > extends Node {
7
7
public verdict : Verdict = Verdict . Unreachable ;
8
- public left : T ;
8
+ private left : T ;
9
9
private _left : string | null = null ;
10
- public right : u64 = 0 ;
10
+ private right : u64 = 0 ;
11
11
private _right : string | null = null ;
12
12
private _not : boolean = false ;
13
13
private op : string = "=" ;
@@ -44,7 +44,7 @@ export class Expectation<T> extends Node {
44
44
* @returns - void
45
45
*/
46
46
toBeGreaterThan ( value : T ) : void {
47
- if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) throw new Error ( "toBeGreaterThan() can only be used on number types. Received " + nameof < T > ( ) + " instead !") ;
47
+ if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) ERROR ( "toBeGreaterThan() can only be used on number types!" ) ;
48
48
49
49
this . verdict = this . left > value ? Verdict . Ok : Verdict . Fail ;
50
50
store < T > ( changetype < usize > ( this ) , value , offsetof < Expectation < T > > ( "right" ) ) ;
@@ -63,7 +63,7 @@ export class Expectation<T> extends Node {
63
63
* @returns - void
64
64
*/
65
65
toBeGreaterOrEqualTo ( value : T ) : void {
66
- if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) throw new Error ( "toBeGreaterOrEqualTo() can only be used on number types. Received " + nameof < T > ( ) + " instead !") ;
66
+ if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) ERROR ( "toBeGreaterOrEqualTo() can only be used on number types!" ) ;
67
67
68
68
this . verdict = this . left >= value ? Verdict . Ok : Verdict . Fail ;
69
69
store < T > ( changetype < usize > ( this ) , value , offsetof < Expectation < T > > ( "right" ) ) ;
@@ -82,7 +82,7 @@ export class Expectation<T> extends Node {
82
82
* @returns - void
83
83
*/
84
84
toBeLessThan ( value : T ) : void {
85
- if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) throw new Error ( "toBeLessThan() can only be used on number types. Received " + nameof < T > ( ) + " instead !") ;
85
+ if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) ERROR ( "toBeLessThan() can only be used on number types!" ) ;
86
86
87
87
this . verdict = this . left < value ? Verdict . Ok : Verdict . Fail ;
88
88
store < T > ( changetype < usize > ( this ) , value , offsetof < Expectation < T > > ( "right" ) ) ;
@@ -101,7 +101,7 @@ export class Expectation<T> extends Node {
101
101
* @returns - void
102
102
*/
103
103
toBeLessThanOrEqualTo ( value : T ) : void {
104
- if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) throw new Error ( "toBeLessThanOrEqualTo() can only be used on number types. Received " + nameof < T > ( ) + " instead !") ;
104
+ if ( ! isInteger < T > ( ) && ! isFloat < T > ( ) ) ERROR ( "toBeLessThanOrEqualTo() can only be used on number types!" ) ;
105
105
106
106
this . verdict = this . left <= value ? Verdict . Ok : Verdict . Fail ;
107
107
store < T > ( changetype < usize > ( this ) , value , offsetof < Expectation < T > > ( "right" ) ) ;
0 commit comments