xref: /freebsd/contrib/one-true-awk/testdir/T.exprconv (revision 23f24377b1a9ab6677f00f2302484d6658d94cab)
1*23f24377SWarner Loshecho T.exprconv:  check conversion of expr to number
2*23f24377SWarner Losh
3*23f24377SWarner Loshawk=${awk-../a.out}
4*23f24377SWarner Losh
5*23f24377SWarner Losh$awk '
6*23f24377SWarner LoshBEGIN {	x = (1 > 0); print x
7*23f24377SWarner Losh	x = (1 < 0); print x
8*23f24377SWarner Losh	x = (1 == 1); print x
9*23f24377SWarner Losh	print ("a" >= "b")
10*23f24377SWarner Losh	print ("b" >= "a")
11*23f24377SWarner Losh	print (0 == 0.0)
12*23f24377SWarner Losh	# x = ((1 == 1e0) && (1 == 10e-1) && (1 == .1e2)); print x
13*23f24377SWarner Losh	exit
14*23f24377SWarner Losh}' >foo1
15*23f24377SWarner Loshecho '1
16*23f24377SWarner Losh0
17*23f24377SWarner Losh1
18*23f24377SWarner Losh0
19*23f24377SWarner Losh1
20*23f24377SWarner Losh1' >foo2
21*23f24377SWarner Loshcmp foo1 foo2 || echo 'BAD: T.exprconv (1 > 0, etc.)'
22