From 9810b8452c02fc4577a476dce37549806dcfed14 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 23 Apr 2025 10:05:11 +0200 Subject: [PATCH] [tests] launcher: asserting that directory separators in classpath are platform-specific GitOrigin-RevId: ef4d9c93fc486b9cff6538f215cab944fe634694 --- native/XPlatLauncher/tests/default_tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/native/XPlatLauncher/tests/default_tests.rs b/native/XPlatLauncher/tests/default_tests.rs index 43174d338acb..513a23ee1310 100644 --- a/native/XPlatLauncher/tests/default_tests.rs +++ b/native/XPlatLauncher/tests/default_tests.rs @@ -5,8 +5,8 @@ pub mod utils; #[cfg(test)] mod tests { use std::{env, fs}; - use std::collections::HashMap; - use std::path::PathBuf; + use std::collections::{HashMap, HashSet}; + use std::path::{PathBuf, MAIN_SEPARATOR}; use xplat_launcher::{get_caches_home, jvm_property}; use crate::utils::*; @@ -68,6 +68,8 @@ mod tests { assert!(classpath.contains("app.jar"), "app.jar is not present in classpath: {}", classpath); let os_specific_jar = format!("boot-{}.jar", env::consts::OS); assert!(classpath.contains(&os_specific_jar), "{} is not present in classpath: {}", os_specific_jar, classpath); + let separators = classpath.chars().filter(|c| *c == '/' || *c == '\\').collect::>(); + assert_eq!(separators, HashSet::from([MAIN_SEPARATOR]), "Unexpected directory separators in {}", classpath); } fn assert_startup_error(result: &LauncherRunResult, message: &str) {