mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-09 14:35:12 +00:00
32 lines
322 B
Bash
32 lines
322 B
Bash
#!/bin/sh
|
|
|
|
echo -n $0: 'Real to integer conversion... '
|
|
|
|
cat >test.bas <<'eof'
|
|
a%=1.2
|
|
print a%
|
|
a%=1.7
|
|
print a%
|
|
a%=-0.2
|
|
print a%
|
|
a%=-0.7
|
|
print a%
|
|
eof
|
|
|
|
cat >test.ref <<'eof'
|
|
1
|
|
2
|
|
0
|
|
-1
|
|
eof
|
|
|
|
sh ./test/runbas test.bas >test.data
|
|
|
|
if cmp test.ref test.data
|
|
then
|
|
rm -f test.*
|
|
echo passed
|
|
else
|
|
echo failed
|
|
exit 1
|
|
fi
|