From 27fa252d629f86f4ea9d95eb9cb1642950f4ae39 Mon Sep 17 00:00:00 2001 From: shayyz-code Date: Tue, 28 Jul 2026 23:28:29 +0630 Subject: [PATCH] test: require complete Cargo test suite --- .github/workflows/pull-request.yml | 2 ++ TODO.md | 5 ++--- src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f0b9354..e308a07 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -56,3 +56,5 @@ jobs: run: cargo fmt --all -- --check - name: Check compilation run: cargo check --all-targets + - name: Run tests + run: cargo test diff --git a/TODO.md b/TODO.md index c7c8e3e..7f5864f 100644 --- a/TODO.md +++ b/TODO.md @@ -10,13 +10,12 @@ Snapshot: 2026-07-28. - `cargo fmt --all -- --check` passes and is enforced for pull requests. - `cargo check --all-targets` passes. -- All 47 integration specifications in `tests/language_specs.rs` pass. +- `cargo test` passes and is enforced for pull requests, including all 47 integration specifications and the library doctest. - The crate exposes checked file/source execution APIs and typed I/O, parse, and runtime error categories. - Lexer, parser, interpreter, type-inference, examples, mdBook documentation, and cargo-dist release assets exist. ### Quality gaps -- `cargo test` fails because the library doctest uses invalid syntax and nonexistent `Value::Integer`. - Strict Clippy reports 36 errors across the interpreter, lexer, parser, type inference, and symbol table. - Panic recovery wraps rather than removes many panic, `unwrap`, and `expect` paths; the interpreter alone contains roughly 90. - `parser.rs` and `interpreter.rs` are approximately 975 and 1,217 lines and mix several responsibilities. @@ -71,7 +70,7 @@ Snapshot: 2026-07-28. ## Phase 1 — Clean Legacy Baselines - [x] Open and complete an issue that applies rustfmt, adds `cargo fmt --all -- --check` to CI, and changes no behavior. -- [ ] Fix the library doctest against the v0.1 API, make `cargo test` green, and require it in CI. +- [x] Fix the library doctest against the v0.1 API, make `cargo test` green, and require it in CI. - [ ] Resolve strict Clippy findings without suppressing project-wide lints, then require `-D warnings` in CI. - [ ] Separate generated mdBook output from sources and define one reproducible documentation build command. - [ ] Reconcile README commands, branch names, CI claims, supported features, and examples with executable behavior. diff --git a/src/lib.rs b/src/lib.rs index 0592b1c..cf33110 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,9 +10,9 @@ //! ```rust //! use poo::{run_source_checked, interpreter::Value}; //! -//! let source = "poo x << 10; return x;".to_string(); +//! let source = "poo x <: 10; return x;".to_string(); //! let result = run_source_checked(source).unwrap(); -//! assert_eq!(result, Some(Value::Integer(10))); +//! assert_eq!(result, Some(Value::Int(10))); //! ``` pub mod ast;