fix: single source of truth for version across crate and tests

Replace all hardcoded "1.1.0" version strings with env!("CARGO_PKG_VERSION")
in src/, so Cargo.toml is the sole source for the built binary. Tests
intentionally use a separate hardcoded constant in tests/common.rs to act
as a canary — they will fail on a version bump until manually updated.

- src/project/mod.rs: add WEEVIL_VERSION const, wire into Tera context,
  generated README, and .weevil-version marker
- tests/common.rs: new file, holds EXPECTED_VERSION for all test crates
- tests/{integration,project_lifecycle,unit/config_tests}.rs: pull from
  common instead of env! or inline literals
This commit is contained in:
Eric Ratliff
2026-01-31 14:17:51 -06:00
parent d2cc62e32f
commit 5596f5bade
10 changed files with 71 additions and 43 deletions

View File

@@ -2,6 +2,10 @@ use assert_cmd::prelude::*;
use predicates::prelude::*;
use std::process::Command;
#[path = "common.rs"]
mod common;
use common::EXPECTED_VERSION;
#[path = "integration/environment_tests.rs"]
mod environment_tests;
@@ -25,7 +29,7 @@ fn test_version_command() {
cmd.assert()
.success()
.stdout(predicate::str::contains("1.0.0"));
.stdout(predicate::str::contains(EXPECTED_VERSION));
}
#[test]