Fixes unit tests
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
55cc0906c9
commit
1e43c07d43
|
@ -7,11 +7,11 @@ steps:
|
|||
- name: test-debug-linux
|
||||
image: deukhoofd/linux64builder
|
||||
commands:
|
||||
- cargo test --color=always
|
||||
- cargo test --color=always -- --test-threads=1
|
||||
- name: test-release-linux
|
||||
image: deukhoofd/linux64builder
|
||||
commands:
|
||||
- cargo test --release --color=always
|
||||
- cargo test --release --color=always -- --test-threads=1
|
||||
depends_on:
|
||||
- test-debug-linux
|
||||
- name: test-miri-release-linux
|
||||
|
@ -28,7 +28,7 @@ steps:
|
|||
RUSTFLAGS: -Zsanitizer=address
|
||||
RUSTDOCFLAGS: -Zsanitizer=address
|
||||
commands:
|
||||
- cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --color=always
|
||||
- cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --color=always -- --test-threads=1
|
||||
depends_on:
|
||||
- test-debug-linux
|
||||
- name: test-coverage
|
||||
|
|
|
@ -792,17 +792,18 @@ pub mod test {
|
|||
use crate::dynamic_data::models::pokemon::Pokemon;
|
||||
use crate::static_data::Gender;
|
||||
use crate::static_data::{AbilityIndex, DataLibrary};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[test]
|
||||
fn construct_pokemon() {
|
||||
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
|
||||
let species = lib.static_data().species().get(&"foo".into()).unwrap();
|
||||
let form = species.get_form(&"default".into()).unwrap();
|
||||
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
|
||||
let form = species.get_form(&"default".into()).unwrap().clone();
|
||||
|
||||
let pokemon = Pokemon::new(
|
||||
&lib,
|
||||
lib,
|
||||
species,
|
||||
form,
|
||||
&form,
|
||||
AbilityIndex {
|
||||
hidden: false,
|
||||
index: 0,
|
||||
|
|
|
@ -476,7 +476,7 @@ mod tests {
|
|||
pub script: ScriptContainer,
|
||||
}
|
||||
|
||||
impl<'a> ScriptSource<'a> for TestScriptSource {
|
||||
impl ScriptSource for TestScriptSource {
|
||||
fn get_script_count(&self) -> usize {
|
||||
1
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ pub mod tests {
|
|||
let mut lib = AbilityLibrary::new(1);
|
||||
lib.add(
|
||||
&StringKey::new("test_ability"),
|
||||
Box::new(Ability::new(&"test_ability".into(), &"test_ability".into(), Vec::new())),
|
||||
Ability::new(&"test_ability".into(), &"test_ability".into(), Vec::new()),
|
||||
);
|
||||
// Drops borrow as mut
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ pub mod tests {
|
|||
let m = build_item();
|
||||
// Borrow as mut so we can insert
|
||||
let w = &mut lib;
|
||||
w.add(&"foo".into(), Box::from(m));
|
||||
w.add(&"foo".into(), m);
|
||||
// Drops borrow as mut
|
||||
|
||||
lib
|
||||
|
|
|
@ -71,7 +71,7 @@ pub mod tests {
|
|||
let species = build_species();
|
||||
// Borrow as mut so we can insert
|
||||
let w = &mut lib;
|
||||
w.add(&"foo".into(), Box::from(species));
|
||||
w.add(&"foo".into(), species);
|
||||
// Drops borrow as mut
|
||||
|
||||
lib
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue