Skip to content

Conversation

@johnchandlerburnham
Copy link
Member

…ommunicate the verification level of each test:

Output Format:

  • ✓ ∃: name — Unit test (verified single case)
  • ✓ ∀: "n" (prop) — Property test with formal proof
  • ✓ ∃₁₀₀: "n" (p) — Property test passed 100 samples (no proof)
  • × ∃²/₁₀₀: "n" (p) — Property test failed on sample 2 of 100

Key Changes:

  1. Track sample counts through SlimCheck

    • runSuiteAux/runSuite/checkIO now return (result, numSamples)
    • Testable constructors track failedAt and totalTests for failures
  2. Add Unicode formatting utilities - natToSubscript: 100 → "₁₀₀" - natToSuperscript: 47 → "⁴⁷"

  3. Add syntax-capturing macros

    • check'/checkIO' capture property syntax for display
    • Produces: ✓ ∃₁₀₀: "add_comm" (∀ n m : Nat, n + m = m + n)
  4. Update output formatting - formatSuccessLine for passing tests - formatFailureLine for failures with superscript/subscript notation

  5. Comprehensive documentation

    • Module-level docs with output format tables
    • Updated examples with expected output comments - Documented all new functions and macros

…ommunicate the verification level of each test:

   Output Format:
   - ✓ ∃: name        — Unit test (verified single case)
   - ✓ ∀: "n" (prop)  — Property test with formal proof
   - ✓ ∃₁₀₀: "n" (p)  — Property test passed 100 samples (no proof)
   - × ∃²/₁₀₀: "n" (p) — Property test failed on sample 2 of 100

   Key Changes:

   1. Track sample counts through SlimCheck
      - runSuiteAux/runSuite/checkIO now return (result, numSamples)
      - Testable constructors track failedAt and totalTests for failures

   2. Add Unicode formatting utilities
      - natToSubscript: 100 → "₁₀₀"
      - natToSuperscript: 47 → "⁴⁷"

   3. Add syntax-capturing macros
      - check'/checkIO' capture property syntax for display
      - Produces: ✓ ∃₁₀₀: "add_comm" (∀ n m : Nat, n + m = m + n)

   4. Update output formatting
      - formatSuccessLine for passing tests
      - formatFailureLine for failures with superscript/subscript notation

   5. Comprehensive documentation
      - Module-level docs with output format tables
      - Updated examples with expected output comments
      - Documented all new functions and macros
Copy link
Member

@arthurpaulino arthurpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks mostly fine. There are just two functions already available from Init, which don't need to be redefined here.

| 5 => '⁵' | 6 => '⁶' | 7 => '⁷' | 8 => '⁸' | _ => '⁹'

/-- Convert a natural number to subscript Unicode string (e.g., 100 → "₁₀₀") -/
def natToSubscript (n : Nat) : String :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Nat.toSubscriptString

String.ofList (go n [])

/-- Convert a natural number to superscript Unicode string (e.g., 47 → "⁴⁷") -/
def natToSuperscript (n : Nat) : String :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Nat.toSuperscriptString

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants