|
|
@@ -0,0 +1,60 @@
|
|
|
+# Showcase 14 — session capabilities end-to-end
|
|
|
+
|
|
|
+Tags `v3-showcase14` (program) and `v3-showcase14-summary` (this doc).
|
|
|
+Suite **127/127**; fixpoint **OK** (2,071,330 bytes).
|
|
|
+
|
|
|
+## What it runs
|
|
|
+
|
|
|
+`compiler/tests/showcase14.mod` (`Showcase14`) links seven modules and
|
|
|
+exercises everything added this session:
|
|
|
+
|
|
|
+```
|
|
|
+IMPORT SysIO, TextIO, Utf8, Conversions, RealIO, ProgramArgs, IOChan;
|
|
|
+```
|
|
|
+
|
|
|
+1. **Enumerations** — `TYPE Color = (red, green, blue)`,
|
|
|
+ `CONST Favourite = blue`; a literal as a `CASE` label, ordinal
|
|
|
+ ordering (`red < green`), and a `CONST` initialiser.
|
|
|
+2. **String content equality** — `"abc" = "abc"`, `"abc" # "abd"`.
|
|
|
+3. **Unicode** — `Utf8.Decode("é", 0, cp, next)` (strict RFC 3629)
|
|
|
+ back to `UCHAR`, checked with `UORD(cp) = 233`.
|
|
|
+4. **Conversions** — `StrToInt("-56")` and `StrToReal("3.5")`
|
|
|
+ round-trips; `IntToStr` used to render the result.
|
|
|
+5. **ProgramArgs** — `ArgCount()` (run with no arguments).
|
|
|
+6. **RealIO / TextIO** — `WriteReal(3.5)` and
|
|
|
+ `UWriteString(U"ok ✓")` (UTF-8).
|
|
|
+7. **IOChan** — `StdErrChan` diagnostics via the channel handle.
|
|
|
+
|
|
|
+Each check adds to an accumulator; the program prints and exits with
|
|
|
+it (42).
|
|
|
+
|
|
|
+## Output
|
|
|
+
|
|
|
+```
|
|
|
+showcase14 n=42
|
|
|
+3.500000E+00 ok ✓
|
|
|
+```
|
|
|
+
|
|
|
+(stdout; the `IOChan` line goes to stderr so that stdio buffering does
|
|
|
+not reorder it against the unbuffered shim writes).
|
|
|
+
|
|
|
+## Registration
|
|
|
+
|
|
|
+`expect_run_files_out Showcase14 42 "showcase14 n=42" …` with the
|
|
|
+`Utf8`/`SysShim`/`sysio`/`textio`/`conversions`/`realio`/`programargs`/
|
|
|
+`iochan` definitions and bodies.
|
|
|
+
|
|
|
+## Session features exercised
|
|
|
+
|
|
|
+| Area | Where |
|
|
|
+| --- | --- |
|
|
|
+| Enums in expressions/CASE/CONST/params | `docs/summary_lang-polish.md` (`v3-lang-polish`) |
|
|
|
+| String `=`/`#` | same |
|
|
|
+| Unicode `UCHAR`/`UString`/`Utf8`/`TextIO.U*` | `docs/summary_unicode.md` (`v3-unicode-1/-2`) |
|
|
|
+| `Conversions` / `RealIO` | `docs/summary_stdlib-conversions.md` |
|
|
|
+| `ProgramArgs` / `IOChan` | `docs/summary_programargs-iochan.md` |
|
|
|
+
|
|
|
+## Files
|
|
|
+
|
|
|
+`compiler/tests/showcase14.mod`, `compiler/run_tests.sh`,
|
|
|
+`docs/summary_showcase14.md`.
|