gcc/testsuite/gm2/iso/run/pass/tstLength.mod
raw| 1 | MODULE tstLength; |
| 2 | |
| 3 | FROM M2RTS IMPORT Length ; |
| 4 | FROM StrIO IMPORT WriteLn, WriteString ; |
| 5 | FROM NumberIO IMPORT WriteCard ; |
| 6 | FROM libc IMPORT exit ; |
| 7 | |
| 8 | VAR |
| 9 | s: ARRAY [1..5] OF CHAR; |
| 10 | BEGIN |
| 11 | s := "What?"; |
| 12 | |
| 13 | WriteString("LENGTH(s) reports "); |
| 14 | WriteCard(LENGTH(s), 4); WriteLn; |
| 15 | |
| 16 | WriteString("Length(s) reports "); |
| 17 | WriteCard(Length(s), 4); WriteLn; |
| 18 | IF LENGTH(s)#Length(s) |
| 19 | THEN |
| 20 | exit(1) |
| 21 | END |
| 22 | END tstLength. |