Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ jobs:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

- run: rustup update --no-self-update stable
- run: rustup default stable

- name: fmt
run: cargo fmt -- --check --color always

- name: clippy
run: cargo clippy --no-deps
run: cargo clippy --no-deps --all-targets -- -D warnings

- name: check
run: cargo check

- name: test
run: cargo test
14 changes: 7 additions & 7 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn setup_test_dir() -> Result<TempDir> {

// Initialize git repo (codegen requires a git repository)
Command::new("git")
.args(&["init"])
.args(["init"])
.current_dir(dir.path())
.assert()
.success();
Expand Down Expand Up @@ -83,7 +83,7 @@ fn test_generate_files() -> Result<()> {

// Run codegen binary directly with --config flag
let mut cmd = Command::cargo_bin("codegen")?;
cmd.args(&["--config", config_path.to_str().unwrap()]);
cmd.args(["--config", config_path.to_str().unwrap()]);

cmd.assert().success();

Expand Down Expand Up @@ -111,12 +111,12 @@ fn test_check_mode() -> Result<()> {

// First generate the file
let mut cmd = Command::cargo_bin("codegen")?;
cmd.args(&["--config", config_path.to_str().unwrap()]);
cmd.args(["--config", config_path.to_str().unwrap()]);
cmd.assert().success();

// Run codegen in check mode with matching files
let mut cmd = Command::cargo_bin("codegen")?;
cmd.args(&["--config", config_path.to_str().unwrap(), "--check"]);
cmd.args(["--config", config_path.to_str().unwrap(), "--check"]);
cmd.assert().success();

// Now modify the generated file to have different content
Expand All @@ -125,7 +125,7 @@ fn test_check_mode() -> Result<()> {

// Run codegen in check mode
let mut cmd = Command::cargo_bin("codegen")?;
cmd.args(&["--config", config_path.to_str().unwrap(), "--check"]);
cmd.args(["--config", config_path.to_str().unwrap(), "--check"]);

cmd.assert().failure();

Expand Down Expand Up @@ -171,7 +171,7 @@ fn test_multiple_templates() -> Result<()> {

// Run codegen and check that all files are generated
let mut cmd = Command::cargo_bin("codegen")?;
cmd.args(&["--config", config_path.to_str().unwrap()]);
cmd.args(["--config", config_path.to_str().unwrap()]);
cmd.assert().success();

assert_snapshot!(std::fs::read_to_string(
Expand Down Expand Up @@ -210,7 +210,7 @@ fn test_error_missing_properties() -> Result<()> {

// Run codegen and check that it fails with an error
let mut cmd = Command::cargo_bin("codegen")?;
cmd.args(&["--config", config_path.to_str().unwrap()]);
cmd.args(["--config", config_path.to_str().unwrap()]);

cmd.assert().failure();

Expand Down
Loading