mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-28 03:37:00 -06:00
refactor(ui-egui): move tests_*.rs to tests/<topic>.rs
This commit is contained in:
+2
-106
@@ -73,113 +73,9 @@ pub mod workspaces;
|
||||
|
||||
mod document_drag;
|
||||
#[cfg(test)]
|
||||
mod tests_adjust;
|
||||
use tests::{background as tests_background, labels as tests_labels, picks as tests_picks, removeanchors as tests_removeanchors, svg as tests_svg, synthetic as tests_synthetic, sysclip as tests_sysclip};
|
||||
#[cfg(test)]
|
||||
mod tests_aisave;
|
||||
#[cfg(test)]
|
||||
mod tests_automation;
|
||||
#[cfg(test)]
|
||||
mod tests_background;
|
||||
#[cfg(test)]
|
||||
mod tests_clipboard;
|
||||
#[cfg(test)]
|
||||
mod tests_contextmenu;
|
||||
#[cfg(test)]
|
||||
mod tests_cut;
|
||||
#[cfg(test)]
|
||||
mod tests_distortkeys;
|
||||
#[cfg(test)]
|
||||
mod tests_docsetup;
|
||||
#[cfg(test)]
|
||||
mod tests_document_drag;
|
||||
#[cfg(test)]
|
||||
mod tests_font_menu;
|
||||
#[cfg(test)]
|
||||
mod tests_fonts;
|
||||
#[cfg(test)]
|
||||
mod tests_guide_escape;
|
||||
#[cfg(test)]
|
||||
mod tests_home;
|
||||
#[cfg(test)]
|
||||
mod tests_labels;
|
||||
#[cfg(test)]
|
||||
mod tests_lifecycle;
|
||||
#[cfg(test)]
|
||||
mod tests_nativemenu;
|
||||
#[cfg(test)]
|
||||
mod tests_nativeoptions;
|
||||
#[cfg(test)]
|
||||
mod tests_numfields;
|
||||
#[cfg(test)]
|
||||
mod tests_overprint;
|
||||
#[cfg(test)]
|
||||
mod tests_paintchips;
|
||||
#[cfg(test)]
|
||||
mod tests_pastechords;
|
||||
#[cfg(test)]
|
||||
mod tests_pathtype;
|
||||
#[cfg(test)]
|
||||
mod tests_pdfoutput;
|
||||
#[cfg(test)]
|
||||
mod tests_picks;
|
||||
#[cfg(test)]
|
||||
mod tests_place;
|
||||
#[cfg(test)]
|
||||
mod tests_plugin_runs;
|
||||
#[cfg(test)]
|
||||
mod tests_plugins;
|
||||
#[cfg(test)]
|
||||
mod tests_printps;
|
||||
#[cfg(test)]
|
||||
mod tests_printtiling;
|
||||
#[cfg(test)]
|
||||
mod tests_puppetwarp;
|
||||
#[cfg(test)]
|
||||
mod tests_recolor;
|
||||
#[cfg(test)]
|
||||
mod tests_recovery;
|
||||
#[cfg(test)]
|
||||
mod tests_removeanchors;
|
||||
#[cfg(test)]
|
||||
mod tests_rotateview;
|
||||
#[cfg(test)]
|
||||
mod tests_ruler_origin;
|
||||
#[cfg(test)]
|
||||
mod tests_save;
|
||||
#[cfg(test)]
|
||||
mod tests_saveext;
|
||||
#[cfg(test)]
|
||||
mod tests_screenmode;
|
||||
#[cfg(test)]
|
||||
mod tests_screenshots;
|
||||
#[cfg(test)]
|
||||
mod tests_script_check;
|
||||
#[cfg(test)]
|
||||
mod tests_scrub;
|
||||
#[cfg(test)]
|
||||
mod tests_selectall;
|
||||
#[cfg(test)]
|
||||
mod tests_slices;
|
||||
#[cfg(test)]
|
||||
mod tests_svg;
|
||||
#[cfg(test)]
|
||||
mod tests_svgsave;
|
||||
#[cfg(test)]
|
||||
mod tests_synthetic;
|
||||
#[cfg(test)]
|
||||
mod tests_sysclip;
|
||||
#[cfg(test)]
|
||||
mod tests_sysclip_emf;
|
||||
#[cfg(test)]
|
||||
mod tests_sysclip_probe;
|
||||
#[cfg(test)]
|
||||
mod tests_tab_overflow;
|
||||
#[cfg(test)]
|
||||
mod tests_taskbar;
|
||||
#[cfg(test)]
|
||||
mod tests_transparencygrid;
|
||||
#[cfg(test)]
|
||||
mod tests_widthtool;
|
||||
mod tests;
|
||||
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::mpsc::{Receiver, Sender};
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
mod adjust;
|
||||
mod aisave;
|
||||
mod automation;
|
||||
pub(super) mod background;
|
||||
mod clipboard;
|
||||
mod contextmenu;
|
||||
mod cut;
|
||||
mod distortkeys;
|
||||
mod docsetup;
|
||||
mod document_drag;
|
||||
mod font_menu;
|
||||
mod fonts;
|
||||
mod guide_escape;
|
||||
mod home;
|
||||
pub(super) mod labels;
|
||||
mod lifecycle;
|
||||
mod nativemenu;
|
||||
mod nativeoptions;
|
||||
mod numfields;
|
||||
mod overprint;
|
||||
mod paintchips;
|
||||
mod pastechords;
|
||||
mod pathtype;
|
||||
mod pdfoutput;
|
||||
pub(super) mod picks;
|
||||
mod place;
|
||||
mod plugin_runs;
|
||||
mod plugins;
|
||||
mod printps;
|
||||
mod printtiling;
|
||||
mod puppetwarp;
|
||||
mod recolor;
|
||||
mod recovery;
|
||||
pub(super) mod removeanchors;
|
||||
mod rotateview;
|
||||
mod ruler_origin;
|
||||
mod save;
|
||||
mod saveext;
|
||||
mod screenmode;
|
||||
mod screenshots;
|
||||
mod script_check;
|
||||
mod scrub;
|
||||
mod selectall;
|
||||
mod slices;
|
||||
pub(super) mod svg;
|
||||
mod svgsave;
|
||||
pub(super) mod synthetic;
|
||||
pub(super) mod sysclip;
|
||||
mod sysclip_emf;
|
||||
mod sysclip_probe;
|
||||
mod tab_overflow;
|
||||
mod taskbar;
|
||||
mod transparencygrid;
|
||||
mod widthtool;
|
||||
@@ -12,17 +12,17 @@ use vectorcraft_geom::{Rect, shapes};
|
||||
use crate::control::ControlRequest;
|
||||
use crate::{Services, VectorcraftApp, background, io};
|
||||
|
||||
pub(super) type Files = Arc<Mutex<Vec<(String, Vec<u8>)>>>;
|
||||
pub(crate) type Files = Arc<Mutex<Vec<(String, Vec<u8>)>>>;
|
||||
|
||||
/// Holds the background writer until opened.
|
||||
#[derive(Clone, Default)]
|
||||
pub(super) struct Gate(Arc<AtomicBool>);
|
||||
pub(crate) struct Gate(Arc<AtomicBool>);
|
||||
|
||||
impl Gate {
|
||||
pub(super) fn open(&self) {
|
||||
pub(crate) fn open(&self) {
|
||||
self.0.store(true, Ordering::SeqCst);
|
||||
}
|
||||
pub(super) fn wait(&self) {
|
||||
pub(crate) fn wait(&self) {
|
||||
while !self.0.load(Ordering::SeqCst) {
|
||||
std::thread::sleep(std::time::Duration::from_millis(1));
|
||||
}
|
||||
@@ -57,7 +57,7 @@ fn paths(n: usize) -> Document {
|
||||
d
|
||||
}
|
||||
|
||||
pub(super) fn written(files: &Files) -> Vec<String> {
|
||||
pub(crate) fn written(files: &Files) -> Vec<String> {
|
||||
files.lock().unwrap().iter().map(|(p, _)| p.clone()).collect()
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use vectorcraft_plugins::wat as tpl;
|
||||
use crate::state::Dialog;
|
||||
use crate::{VectorcraftApp, dialogs, io, menus, theme};
|
||||
|
||||
const DESATURATE: &[u8] = include_bytes!("../../plugins/tests/fixtures/desaturate.wasm");
|
||||
const DESATURATE: &[u8] = include_bytes!("../../../plugins/tests/fixtures/desaturate.wasm");
|
||||
const DESATURATE_ID: &str = "org.vectorcraft.example.desaturate";
|
||||
|
||||
fn app() -> VectorcraftApp {
|
||||
@@ -143,7 +143,7 @@ fn text_and_image_paste_events_paste_once_as_text() {
|
||||
}
|
||||
|
||||
/// A 4 × 2 px blue PNG.
|
||||
pub(super) fn blue_png() -> Vec<u8> {
|
||||
pub(crate) fn blue_png() -> Vec<u8> {
|
||||
let img = image::RgbaImage::from_pixel(4, 2, image::Rgba([0, 0, 255, 255]));
|
||||
let mut png = vec![];
|
||||
img.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap();
|
||||
Reference in New Issue
Block a user