xref: /aosp_15_r20/external/one-true-awk/testdir/T.exprconv (revision 9a7741de182b2776d7b30d6355f2585c0780a51b)
1*9a7741deSElliott Hughesecho T.exprconv:  check conversion of expr to number
2*9a7741deSElliott Hughes
3*9a7741deSElliott Hughesawk=${awk-../a.out}
4*9a7741deSElliott Hughes
5*9a7741deSElliott Hughes$awk '
6*9a7741deSElliott HughesBEGIN {	x = (1 > 0); print x
7*9a7741deSElliott Hughes	x = (1 < 0); print x
8*9a7741deSElliott Hughes	x = (1 == 1); print x
9*9a7741deSElliott Hughes	print ("a" >= "b")
10*9a7741deSElliott Hughes	print ("b" >= "a")
11*9a7741deSElliott Hughes	print (0 == 0.0)
12*9a7741deSElliott Hughes	# x = ((1 == 1e0) && (1 == 10e-1) && (1 == .1e2)); print x
13*9a7741deSElliott Hughes	exit
14*9a7741deSElliott Hughes}' >foo1
15*9a7741deSElliott Hughesecho '1
16*9a7741deSElliott Hughes0
17*9a7741deSElliott Hughes1
18*9a7741deSElliott Hughes0
19*9a7741deSElliott Hughes1
20*9a7741deSElliott Hughes1' >foo2
21*9a7741deSElliott Hughescmp foo1 foo2 || echo 'BAD: T.exprconv (1 > 0, etc.)'
22