Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused files #124

Merged
merged 3 commits into from
Feb 17, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Removed `scripts/build.sh` and `scripts/flash.sh` scripts (#124)

## [0.2.2] - 2025-01-16

### Added
Expand Down
40 changes: 40 additions & 0 deletions src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct Version {
patch: u8,
}

#[derive(Debug, PartialEq, Eq)]
enum CheckResult {
Ok,
WrongVersion,
Expand Down Expand Up @@ -82,3 +83,42 @@ fn get_version(cmd: &str, args: &[&str]) -> Option<Version> {
Err(_) => None,
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_check_version() {
// Ok
let version = Some(Version {
major: 1,
minor: 84,
patch: 0,
});
assert_eq!(check_version(version, 1, 84, 0), CheckResult::Ok);
// Wrong major
let version = Some(Version {
major: 0,
minor: 85,
patch: 0,
});
assert_eq!(check_version(version, 1, 84, 0), CheckResult::WrongVersion);
// Wrong minor
let version = Some(Version {
major: 1,
minor: 83,
patch: 0,
});
assert_eq!(check_version(version, 1, 84, 0), CheckResult::WrongVersion);
// Wrong patch
let version = Some(Version {
major: 1,
minor: 84,
patch: 0,
});
assert_eq!(check_version(version, 1, 84, 1), CheckResult::WrongVersion);
// Not found
assert_eq!(check_version(None, 1, 84, 0), CheckResult::NotFound);
}
}
19 changes: 0 additions & 19 deletions template/scripts/build.sh

This file was deleted.

22 changes: 0 additions & 22 deletions template/scripts/flash.sh

This file was deleted.