@@ -21,8 +21,8 @@ function t_test_fcns(quiet)
2121end
2222
2323ntests = 5 ;
24- npass = 29 ;
25- nfail = 18 ;
24+ npass = 34 ;
25+ nfail = 27 ;
2626
2727g = [];
2828e = [];
@@ -62,36 +62,90 @@ function t_test_fcns(quiet)
6262got = 3 ;
6363g(k ) = t_is(got , expected , tol , t );
6464
65+ k = k + 1 ; e(k ) = 1 ;
66+ t = sprintf(' %s : t_is(Inf, Inf, ...)' , f(e(k )));
67+ expected = Inf ;
68+ got = Inf ;
69+ g(k ) = t_is(got , expected , tol , t );
70+
71+ k = k + 1 ; e(k ) = 1 ;
72+ t = sprintf(' %s : t_is(-Inf, -Inf, ...)' , f(e(k )));
73+ expected = - Inf ;
74+ got = - Inf ;
75+ g(k ) = t_is(got , expected , tol , t );
76+
6577k = k + 1 ; e(k ) = 0 ;
6678t = sprintf(' %s : t_is(1, 3, ...)' , f(e(k )));
6779expected = 3 ;
6880got = 1 ;
6981g(k ) = t_is(got , expected , tol , t );
7082
83+ k = k + 1 ; e(k ) = 0 ;
84+ t = sprintf(' %s : t_is(Inf, 3, ...)' , f(e(k )));
85+ expected = 3 ;
86+ got = Inf ;
87+ g(k ) = t_is(got , expected , tol , t );
88+
89+ k = k + 1 ; e(k ) = 0 ;
90+ t = sprintf(' %s : t_is(1, -Inf, ...)' , f(e(k )));
91+ expected = - Inf ;
92+ got = 1 ;
93+ g(k ) = t_is(got , expected , tol , t );
94+
7195k = k + 1 ; e(k ) = 1 ;
7296t = sprintf(' %s : t_is([3 3; 3 3], 3, ...)' , f(e(k )));
7397expected = 3 ;
7498got = [3 3 ; 3 3 ];
7599g(k ) = t_is(got , expected , tol , t );
76100
101+ k = k + 1 ; e(k ) = 1 ;
102+ t = sprintf(' %s : t_is([Inf Inf; Inf Inf], Inf, ...)' , f(e(k )));
103+ expected = Inf ;
104+ got = [Inf Inf ; Inf Inf ];
105+ g(k ) = t_is(got , expected , tol , t );
106+
77107k = k + 1 ; e(k ) = 0 ;
78108t = sprintf(' %s : t_is([3 4; 3 3], 3, ...)' , f(e(k )));
79109expected = 3 ;
80110got = [3 4 ; 3 3 ];
81111g(k ) = t_is(got , expected , tol , t );
82112
113+ k = k + 1 ; e(k ) = 0 ;
114+ t = sprintf(' %s : t_is([Inf 4; Inf Inf], Inf, ...)' , f(e(k )));
115+ expected = Inf ;
116+ got = [Inf 4 ; Inf Inf ];
117+ g(k ) = t_is(got , expected , tol , t );
118+
83119k = k + 1 ; e(k ) = 1 ;
84120t = sprintf(' %s : t_is([3 3; 4 3], [3 3; 4 3], ...)' , f(e(k )));
85121expected = [3 3 ; 4 3 ];
86122got = [3 3 ; 4 3 ];
87123g(k ) = t_is(got , expected , tol , t );
88124
125+ k = k + 1 ; e(k ) = 1 ;
126+ t = sprintf(' %s : t_is([3 -Inf; 4 3], [3 -Inf; 4 3], ...)' , f(e(k )));
127+ expected = [3 - Inf ; 4 3 ];
128+ got = [3 - Inf ; 4 3 ];
129+ g(k ) = t_is(got , expected , tol , t );
130+
89131k = k + 1 ; e(k ) = 0 ;
90132t = sprintf(' %s : t_is([3 4; 3 3], [3 3; 4 3], ...)' , f(e(k )));
91133expected = [3 3 ; 4 3 ];
92134got = [3 4 ; 3 3 ];
93135g(k ) = t_is(got , expected , tol , t );
94136
137+ k = k + 1 ; e(k ) = 0 ;
138+ t = sprintf(' %s : t_is([3 4; 3 -Inf], [3 3; 4 3], ...)' , f(e(k )));
139+ expected = [3 3 ; 4 3 ];
140+ got = [3 4 ; 3 - Inf ];
141+ g(k ) = t_is(got , expected , tol , t );
142+
143+ k = k + 1 ; e(k ) = 0 ;
144+ t = sprintf(' %s : t_is([3 3; 4 -Inf], [3 3; 4 Inf], ...)' , f(e(k )));
145+ expected = [3 3 ; 4 Inf ];
146+ got = [3 3 ; 4 - Inf ];
147+ g(k ) = t_is(got , expected , tol , t );
148+
95149k = k + 1 ; e(k ) = 1 ;
96150t = sprintf(' %s : t_is(ones(2,4,3), ones(2,4,3), ...)' , f(e(k )));
97151expected = ones(2 ,4 ,3 );
@@ -148,12 +202,42 @@ function t_test_fcns(quiet)
148202got = NaN ;
149203g(k ) = t_is(got , expected , tol , t );
150204
205+ k = k + 1 ; e(k ) = 0 ;
206+ t = sprintf(' %s : t_is(-Inf, NaN, ...)' , f(e(k )));
207+ expected = NaN ;
208+ got = - Inf ;
209+ g(k ) = t_is(got , expected , tol , t );
210+
211+ k = k + 1 ; e(k ) = 0 ;
212+ t = sprintf(' %s : t_is(NaN, Inf, ...)' , f(e(k )));
213+ expected = Inf ;
214+ got = NaN ;
215+ g(k ) = t_is(got , expected , tol , t );
216+
151217k = k + 1 ; e(k ) = 1 ;
152218t = sprintf(' %s : t_is(NaN(3,2), NaN, ...)' , f(e(k )));
153219expected = NaN ;
154220got = NaN(3 ,2 );
155221g(k ) = t_is(got , expected , tol , t );
156222
223+ k = k + 1 ; e(k ) = 1 ;
224+ t = sprintf(' %s : t_is([3 4; NaN Inf], [3 4; NaN Inf], ...)' , f(e(k )));
225+ expected = [3 4 ; NaN Inf ];
226+ got = [3 4 ; NaN Inf ];
227+ g(k ) = t_is(got , expected , tol , t );
228+
229+ k = k + 1 ; e(k ) = 0 ;
230+ t = sprintf(' %s : t_is([3 4; NaN Inf], [3 4; Inf NaN], ...)' , f(e(k )));
231+ expected = [3 4 ; Inf NaN ];
232+ got = [3 4 ; NaN Inf ];
233+ g(k ) = t_is(got , expected , tol , t );
234+
235+ k = k + 1 ; e(k ) = 0 ;
236+ t = sprintf(' %s : t_is([3 4.001; NaN Inf], [3 4; NaN Inf], ...)' , f(e(k )));
237+ expected = [3 4 ; NaN Inf ];
238+ got = [3 4.001 ; NaN Inf ];
239+ g(k ) = t_is(got , expected , 4 , t );
240+
157241k = k + 1 ; e(k ) = 0 ;
158242t = sprintf(' %s : t_is(int32(0.6), 1.0, ...)' , f(e(k )));
159243expected = 0.6 ;
0 commit comments