; Arbor Test Harness - AmigaDOS Script ; Full formal validation test suite for arbor v1.2 ; Based on the formal specification of the "arbor" capsule ; ; Save as: arbor_test ; Make executable: protect arbor_test +e ; Set stack size for large tree rendering stack 65536 ; Change to the script's directory (adjust path as needed) ; CD Work:arbor ; Check if c/arbor_68k exists IF NOT EXISTS c/arbor_68k Echo "Error: c/arbor_68k not found!" Echo "Current directory: " CD Quit ENDIF Echo "========================================" Echo " Arbor Test Suite - Formal Validation" Echo "========================================" Echo "Testing against formal specification v1.2" Echo "Using arbor: c/arbor_68k" Echo "" ; Try to get version c/arbor_68k --version >NIL: 2>NIL: IF WARN Echo "Arbor version: unknown" ELSE Echo "Arbor version: " c/arbor_68k --version ENDIF Echo "" ; ======================================== ; Test 1: Normalization - Single Path, No Special Characters ; ======================================== Echo "========================================" Echo "Test 1: Single path with two components" Echo "Input: /usr/bin" Echo "----------------------------------------" c/arbor_68k "/usr/bin" Echo "" Echo "" ; ======================================== ; Test 2: Normalization - Multiple Separators ; ======================================== Echo "========================================" Echo "Test 2: Multiple separators between components" Echo "Input: /usr//bin" Echo "----------------------------------------" c/arbor_68k "/usr//bin" Echo "" Echo "" ; ======================================== ; Test 3: Normalization - Missing Leading Slash ; ======================================== Echo "========================================" Echo "Test 3: Missing leading slash" Echo "Input: usr/bin" Echo "----------------------------------------" c/arbor_68k "usr/bin" Echo "" Echo "" ; ======================================== ; Test 4: Normalization - Trailing Slash ; ======================================== Echo "========================================" Echo "Test 4: Trailing slash" Echo "Input: /usr/bin/" Echo "----------------------------------------" c/arbor_68k "/usr/bin/" Echo "" Echo "" ; ======================================== ; Test 5: Normalization - Root Only ; ======================================== Echo "========================================" Echo "Test 5: Root only" Echo "Input: /" Echo "----------------------------------------" c/arbor_68k "/" Echo "" Echo "" ; ======================================== ; Test 6: Root Visibility - Single Component Path ; ======================================== Echo "========================================" Echo "Test 6: Single component path" Echo "Input: /a" Echo "----------------------------------------" c/arbor_68k "/a" Echo "" Echo "" ; ======================================== ; Test 7: Root Visibility - Multiple Single-Component Paths ; ======================================== Echo "========================================" Echo "Test 7: Multiple single-component paths" Echo "Input: /a /b" Echo "----------------------------------------" c/arbor_68k "/a" "/b" Echo "" Echo "" ; ======================================== ; Test 8: Root Visibility - Shared Prefix with Branching ; ======================================== Echo "========================================" Echo "Test 8: Shared prefix with branching" Echo "Input: /a/b /a/c" Echo "----------------------------------------" c/arbor_68k "/a/b" "/a/c" Echo "" Echo "" ; ======================================== ; Test 9: Contraction - Single Chain with Terminal Child ; ======================================== Echo "========================================" Echo "Test 9: Single chain with terminal child" Echo "Input: /a/b/c" Echo "----------------------------------------" c/arbor_68k "/a/b/c" Echo "" Echo "" ; ======================================== ; Test 10: Contraction - Branching Child as Final Absorbed ; ======================================== Echo "========================================" Echo "Test 10: Branching at final absorbed node" Echo "Input: /a/b/c /a/b/d" Echo "----------------------------------------" c/arbor_68k "/a/b/c" "/a/b/d" Echo "" Echo "" ; ======================================== ; Test 11: Contraction - Mixed Chain Lengths ; ======================================== Echo "========================================" Echo "Test 11: Mixed depths with branching" Echo "Input: /a/b/c /a/b/d/e" Echo "----------------------------------------" c/arbor_68k "/a/b/c" "/a/b/d/e" Echo "" Echo "" ; ======================================== ; Test 12: Root Visibility - Mixed Components with Common Prefix ; ======================================== Echo "========================================" Echo "Test 12: Mixed single/multi components" Echo "Input: /a /a/b" Echo "----------------------------------------" c/arbor_68k "/a" "/a/b" Echo "" Echo "" ; ======================================== ; Test 13: Centering - Even-Length Labels ; ======================================== Echo "========================================" Echo "Test 13: Even-length labels" Echo "Input: /ab/c /ab/d" Echo "----------------------------------------" c/arbor_68k "/ab/c" "/ab/d" Echo "" Echo "" ; ======================================== ; Test 14: Sibling Order Irrelevance ; ======================================== Echo "========================================" Echo "Test 14: Sibling order variation" Echo "Input: /a/c /a/b" Echo "----------------------------------------" c/arbor_68k "/a/c" "/a/b" Echo "" Echo "" ; ======================================== ; Test 15: Multiple Levels with Different Branching ; ======================================== Echo "========================================" Echo "Test 15: Complex nested branching" Echo "Input: /a/b/x /a/b/y /a/c/z" Echo "----------------------------------------" c/arbor_68k "/a/b/x" "/a/b/y" "/a/c/z" Echo "" Echo "" ; ======================================== ; Test 16: Empty Component After Normalization ; ======================================== Echo "========================================" Echo "Test 16: Multiple separators and trailing slash" Echo "Input: /a//b/" Echo "----------------------------------------" c/arbor_68k "/a//b/" Echo "" Echo "" ; ======================================== ; Test 17: Maximal Run of Separators at Beginning ; ======================================== Echo "========================================" Echo "Test 17: Leading separators" Echo "Input: ////a/b" Echo "----------------------------------------" c/arbor_68k "////a/b" Echo "" Echo "" ; ======================================== ; Test 18: Deeply Nested Single Chain ; ======================================== Echo "========================================" Echo "Test 18: Deeply nested chain" Echo "Input: /a/b/c/d/e" Echo "----------------------------------------" c/arbor_68k "/a/b/c/d/e" Echo "" Echo "" ; ======================================== ; Test 19: Mixed Single-Component and Multi-Component Paths ; ======================================== Echo "========================================" Echo "Test 19: Mixed path lengths under root" Echo "Input: /a /b/c /b/d" Echo "----------------------------------------" c/arbor_68k "/a" "/b/c" "/b/d" Echo "" Echo "" ; ======================================== ; Test 20: Path Components with Non-Alphanumeric Characters ; ======================================== Echo "========================================" Echo "Test 20: Valid non-alphanumeric components" Echo "Input: /usr/local/bin /usr/local/lib" Echo "----------------------------------------" c/arbor_68k "/usr/local/bin" "/usr/local/lib" Echo "" Echo "" ; ======================================== ; Additional Test: Space-separated paths ; ======================================== Echo "========================================" Echo "Additional Test: Space-separated paths" Echo 'Input: "/a/b /a/c" (single argument with spaces)' Echo "----------------------------------------" c/arbor_68k "/a/b /a/c" IF WARN Echo "Failed (as expected for invalid syntax)" ELSE Echo "Note: Space-separated paths were accepted" ENDIF Echo "" Echo "" ; ======================================== ; Additional Test: Paths with spaces in components ; ======================================== Echo "========================================" Echo "Additional Test: Paths with spaces (should fail or handle)" Echo "Input: /usr/local/bin /usr/local/lib" Echo "----------------------------------------" c/arbor_68k "/usr/local/bin" "/usr/local/lib" Echo "" Echo "" ; ======================================== ; Test Summary ; ======================================== Echo "========================================" Echo " Test Suite Summary" Echo "========================================" Echo "All 20 core tests and 2 additional tests" Echo "have been processed." Echo "" Echo "Check output above for PASS/FAIL status." Echo "========================================" Echo "Arbor test harness completed successfully."