Release(0.1.7) - Test, release and Format
Also renamed files
This commit is contained in:
parent
a54c09bc66
commit
72a1fa4fdc
|
|
@ -590,7 +590,7 @@ checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
|||
|
||||
[[package]]
|
||||
name = "xiv_csolver"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"lazy_static",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "xiv_csolver"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
edition = "2021"
|
||||
authors = ["谭俊健","Dandaedre","Vkyfox"]
|
||||
description = "Small XIV solver library in rust, with python and rust bindings"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ build-backend = "maturin"
|
|||
[project] # The rust bindings
|
||||
name = "xiv_csolver_lib"
|
||||
requires-python = ">=3.7"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
classifiers = [
|
||||
"Programming Language :: Rust",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ authors = [
|
|||
{name="Dandaedre"},
|
||||
]
|
||||
requires-python = ">=3.7"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
license = {text="Mozilla Public License Version 2.0"}
|
||||
classifiers = [
|
||||
"Programming Language :: Rust",
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 248 KiB |
|
Before Width: | Height: | Size: 352 KiB After Width: | Height: | Size: 352 KiB |
11
src/craft.rs
11
src/craft.rs
|
|
@ -184,14 +184,9 @@ impl<'a> Display for Craft<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod test{
|
||||
mod test {
|
||||
// Struct Test
|
||||
#[test]
|
||||
pub fn struct_tests(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
pub fn struct_tests() {}
|
||||
}
|
||||
|
|
|
|||
55
src/specs.rs
55
src/specs.rs
|
|
@ -186,7 +186,7 @@ impl BuffState {
|
|||
|
||||
/// State the craft is in, used to keep track of wether the craft
|
||||
/// is to be worked on, added to the success vector or discarded
|
||||
#[derive(Debug,Clone,PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Success {
|
||||
/// Pending success and therefor still ongoing
|
||||
Pending,
|
||||
|
|
@ -200,45 +200,52 @@ pub enum Success {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
// Test default values
|
||||
use pretty_assertions::{assert_eq};
|
||||
use pretty_assertions::assert_eq;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
#[test]
|
||||
pub fn test_structs() {
|
||||
format!("{:?}",crate::specs::Recipe {
|
||||
durability: 0,
|
||||
progress: 0,
|
||||
progress_divider: 0,
|
||||
progress_modifier: 0,
|
||||
quality: 0,
|
||||
quality_divider: 0,
|
||||
quality_modifier: 0,
|
||||
}.clone());
|
||||
format!(
|
||||
"{:?}",
|
||||
crate::specs::Recipe {
|
||||
durability: 0,
|
||||
progress: 0,
|
||||
progress_divider: 0,
|
||||
progress_modifier: 0,
|
||||
quality: 0,
|
||||
quality_divider: 0,
|
||||
quality_modifier: 0,
|
||||
}
|
||||
.clone()
|
||||
);
|
||||
|
||||
format!("{:?}",crate::specs::Stats {
|
||||
craftsmanship: 0,
|
||||
control: 0,
|
||||
max_cp: 0,
|
||||
}
|
||||
.clone());
|
||||
format!(
|
||||
"{:?}",
|
||||
crate::specs::Stats {
|
||||
craftsmanship: 0,
|
||||
control: 0,
|
||||
max_cp: 0,
|
||||
}
|
||||
.clone()
|
||||
);
|
||||
|
||||
let iq = crate::specs::Buff::InnerQuiet;
|
||||
assert_eq!(crate::specs::Buff::InnerQuiet, iq);
|
||||
for buff in crate::specs::Buff::iter(){
|
||||
format!("{:?}",buff);
|
||||
for buff in crate::specs::Buff::iter() {
|
||||
format!("{:?}", buff);
|
||||
}
|
||||
format!("{:?}", crate::specs::BuffState::default().clone());
|
||||
|
||||
let sc = crate::specs::Success::Pending;
|
||||
assert!(crate::specs::Success::Pending==sc);
|
||||
assert!(crate::specs::Success::Success!=sc);
|
||||
format!("{:?}",sc);
|
||||
assert!(crate::specs::Success::Pending == sc);
|
||||
assert!(crate::specs::Success::Success != sc);
|
||||
format!("{:?}", sc);
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_buffstate() {
|
||||
let mut bbs = crate::specs::BuffState::default();
|
||||
for buff in crate::specs::Buff::iter(){
|
||||
for buff in crate::specs::Buff::iter() {
|
||||
bbs.apply(buff, 2);
|
||||
}
|
||||
assert_eq!(bbs.inner_quiet, 2);
|
||||
|
|
@ -261,7 +268,7 @@ mod tests {
|
|||
bbs.tick();
|
||||
assert_eq!(bbs.inner_quiet, 3);
|
||||
assert_eq!(bbs.innovation, 4);
|
||||
for buff in crate::specs::Buff::iter(){
|
||||
for buff in crate::specs::Buff::iter() {
|
||||
bbs.remove(buff);
|
||||
}
|
||||
assert_eq!(bbs.inner_quiet, 0);
|
||||
|
|
|
|||
Reference in New Issue