Skip to content

Commit d126d9c

Browse files
committed
chore: migrate tests/* crates to edition 2024
1 parent 242f6a5 commit d126d9c

File tree

16 files changed

+32
-25
lines changed

16 files changed

+32
-25
lines changed

tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tests"
33
authors = ["Aaron Hill <[email protected]>"]
4-
edition.workspace = true
4+
edition = "2024"
55
homepage.workspace = true
66
license.workspace = true
77
repository.workspace = true

tests/framework/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ruffle_test_framework"
33
authors.workspace = true
4-
edition.workspace = true
4+
edition = "2024"
55
homepage.workspace = true
66
license.workspace = true
77
repository.workspace = true

tests/framework/src/backends/audio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use ruffle_core::backend::audio::{
2-
swf, AudioBackend, AudioMixer, DecodeError, RegisterError, SoundHandle, SoundInstanceHandle,
3-
SoundStreamInfo, SoundTransform,
2+
AudioBackend, AudioMixer, DecodeError, RegisterError, SoundHandle, SoundInstanceHandle,
3+
SoundStreamInfo, SoundTransform, swf,
44
};
55
use ruffle_core::impl_audio_mixer_backend;
66

tests/framework/src/backends/navigator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use async_channel::{Receiver, Sender};
44
use percent_encoding::percent_decode_str;
55
use ruffle_core::backend::log::LogBackend;
66
use ruffle_core::backend::navigator::{
7-
async_return, create_fetch_error, ErrorResponse, NavigationMethod, NavigatorBackend,
8-
NullExecutor, NullSpawner, OwnedFuture, Request, SuccessResponse,
7+
ErrorResponse, NavigationMethod, NavigatorBackend, NullExecutor, NullSpawner, OwnedFuture,
8+
Request, SuccessResponse, async_return, create_fetch_error,
99
};
1010
use ruffle_core::indexmap::IndexMap;
1111
use ruffle_core::loader::Error;

tests/framework/src/backends/ui.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ use std::collections::HashMap;
33
use crate::test::Font;
44
use chrono::{DateTime, Utc};
55
use ruffle_core::{
6+
FontFileData, FontQuery,
67
backend::ui::{
78
DialogLoaderError, DialogResultFuture, FileDialogResult, FileFilter, FontDefinition,
8-
FullscreenError, LanguageIdentifier, MouseCursor, UiBackend, US_ENGLISH,
9+
FullscreenError, LanguageIdentifier, MouseCursor, US_ENGLISH, UiBackend,
910
},
10-
FontFileData, FontQuery,
1111
};
1212
use url::Url;
1313

tests/framework/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use crate::options::approximations::Approximations;
99
use crate::options::font::{DefaultFontsOptions, FontOptions, FontSortOptions};
1010
use crate::options::image_comparison::ImageComparison;
1111
use crate::options::player::PlayerOptions;
12-
use anyhow::{bail, Result};
12+
use anyhow::{Result, bail};
1313
use serde::Deserialize;
1414
use std::collections::{HashMap, HashSet};
15-
use toml::de::{DeTable, DeValue};
1615
use toml::Spanned;
16+
use toml::de::{DeTable, DeValue};
1717
use vfs::VfsPath;
1818

1919
fn merge_into_subtest<'a>(

tests/framework/src/runner.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use crate::backends::{TestLogBackend, TestNavigatorBackend, TestUiBackend};
66
use crate::environment::RenderInterface;
77
use crate::fs_commands::{FsCommand, TestFsCommandProvider};
88
use crate::image_trigger::ImageTrigger;
9-
use crate::options::image_comparison::ImageComparison;
109
use crate::options::TestOptions;
10+
use crate::options::image_comparison::ImageComparison;
1111
use crate::runner::automation::perform_automated_event;
1212
use crate::runner::image_test::capture_and_compare_image;
1313
use crate::runner::trace::compare_trace_output;
1414
use crate::test::Test;
15-
use anyhow::{anyhow, Result};
15+
use anyhow::{Result, anyhow};
1616
use ruffle_core::backend::navigator::NullExecutor;
1717
use ruffle_core::limits::ExecutionLimit;
1818
use ruffle_core::tag_utils::SwfMovie;
@@ -21,7 +21,7 @@ use ruffle_input_format::InputInjector;
2121
use ruffle_render::backend::{RenderBackend, ViewportDimensions};
2222
use ruffle_socket_format::SocketEvent;
2323
use std::collections::HashMap;
24-
use std::sync::{mpsc, Arc, Mutex};
24+
use std::sync::{Arc, Mutex, mpsc};
2525
use std::time::Duration;
2626
use vfs::VfsPath;
2727

@@ -196,7 +196,10 @@ impl TestRunner {
196196
FsCommand::CaptureImage(name) => {
197197
if let Some(image_comparison) = self.images.remove(&name) {
198198
if image_comparison.trigger != ImageTrigger::FsCommand {
199-
return Err(anyhow!("Encountered fscommand to capture and compare image '{name}', but the trigger was expected to be {:?}", image_comparison.trigger));
199+
return Err(anyhow!(
200+
"Encountered fscommand to capture and compare image '{name}', but the trigger was expected to be {:?}",
201+
image_comparison.trigger
202+
));
200203
}
201204
capture_and_compare_image(
202205
&self.root_path,
@@ -207,7 +210,9 @@ impl TestRunner {
207210
self.render_interface.as_deref(),
208211
)?;
209212
} else {
210-
return Err(anyhow!("Encountered fscommand to capture and compare image '{name}', but no [image_comparison] was set up for this."));
213+
return Err(anyhow!(
214+
"Encountered fscommand to capture and compare image '{name}', but no [image_comparison] was set up for this."
215+
));
211216
}
212217
}
213218
}

tests/framework/src/runner/image_test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ pub fn test(
125125

126126
any_check_executed = true;
127127
if outliers <= max_outliers {
128-
println!("{check_name} succeeded: {outliers} outliers found, max difference {max_difference}");
128+
println!(
129+
"{check_name} succeeded: {outliers} outliers found, max difference {max_difference}"
130+
);
129131
continue;
130132
}
131133

tests/framework/src/runner/trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::options::TestOptions;
2-
use anyhow::{anyhow, Error};
2+
use anyhow::{Error, anyhow};
33
use pretty_assertions::Comparison;
44
use vfs::VfsPath;
55

tests/framework/src/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::environment::Environment;
44
use crate::options::TestOptions;
55
use crate::runner::TestRunner;
66
use crate::util::read_bytes;
7-
use anyhow::{anyhow, Result};
8-
use ruffle_core::{tag_utils::SwfMovie, FontQuery, FontType};
7+
use anyhow::{Result, anyhow};
8+
use ruffle_core::{FontQuery, FontType, tag_utils::SwfMovie};
99
use ruffle_input_format::InputInjector;
1010
use ruffle_socket_format::SocketEvent;
1111
use vfs::VfsPath;

0 commit comments

Comments
 (0)