fix: CI fallout from the i18n refactor + Windows path assertions
examples/screenshot.rs: migrate to language_code()/set_language_code
(the Language enum is gone); only CI's example build caught it — local
--lib runs never compile examples.
oakcodec tests: build path expectations with Path::join instead of
'/'-joined literals — production uses platform-native separators, so
the derivation assertions failed on Windows ("dir\img007.jpg" vs
"dir/img007.jpg"). Behaviour unchanged; the tests were never reached
on Windows before (earlier failures aborted the run first).
oakui::ofx interact test: poll up to 5s for the destroy marker record
before asserting. The active-interact slot is process-global; a
concurrent viewer frame sync from another test's real engine can take
the interact out of the slot and be preempted between take and
destroy, so the plugin's destroy record occasionally lands a few
milliseconds after this test removed the marker env var (Linux CI:
"lifecycle actions missing: [...]" with everything but destroy
present).
This commit is contained in:
@@ -273,8 +273,18 @@ mod tests {
|
||||
let f1 = m
|
||||
.get_conform_filename(&cache, &src.to_string_lossy(), 0, 48000, 0x3, 0, 1)
|
||||
.unwrap();
|
||||
assert_eq!(f0, format!("{}/{}.0.pcm", cache, base));
|
||||
assert_eq!(f1, format!("{}/{}.1.pcm", cache, base));
|
||||
assert_eq!(
|
||||
f0,
|
||||
std::path::Path::new(&cache)
|
||||
.join(format!("{base}.0.pcm"))
|
||||
.to_string_lossy()
|
||||
);
|
||||
assert_eq!(
|
||||
f1,
|
||||
std::path::Path::new(&cache)
|
||||
.join(format!("{base}.1.pcm"))
|
||||
.to_string_lossy()
|
||||
);
|
||||
// Out of range.
|
||||
assert!(matches!(
|
||||
m.get_conform_filename(&cache, &src.to_string_lossy(), 0, 48000, 0x3, 0, 5),
|
||||
|
||||
@@ -629,7 +629,10 @@ mod tests {
|
||||
);
|
||||
assert_eq!(
|
||||
transform_image_sequence_file_name("dir/img012.jpg", 7),
|
||||
"dir/img007.jpg"
|
||||
// Path::join separators are platform-native (\ on Windows).
|
||||
std::path::Path::new("dir")
|
||||
.join("img007.jpg")
|
||||
.to_string_lossy()
|
||||
);
|
||||
// No digit run: number appended with no padding (C++ behavior).
|
||||
assert_eq!(
|
||||
|
||||
@@ -508,7 +508,10 @@ mod tests {
|
||||
fn proxy_directory_is_cache_slash_proxy() {
|
||||
assert_eq!(
|
||||
ProxyManager::get_proxy_directory("/tmp/cache").unwrap(),
|
||||
"/tmp/cache/proxy"
|
||||
// Path::join separators are platform-native (\ on Windows).
|
||||
std::path::Path::new("/tmp/cache")
|
||||
.join("proxy")
|
||||
.to_string_lossy()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -522,7 +525,12 @@ mod tests {
|
||||
// C++ parity), so the name is the plain size/version/audio tags.
|
||||
let missing = std::path::Path::new(&temp_subdir("missing")).join("nope.mp4");
|
||||
let f = ProxyManager::get_proxy_filename(&cache, missing.to_str().unwrap(), 0, &p).unwrap();
|
||||
assert_eq!(f, format!("{}/proxy/-0.1280x720.v1.a1.mp4", cache));
|
||||
let plain = std::path::Path::new(&cache)
|
||||
.join("proxy")
|
||||
.join("-0.1280x720.v1.a1.mp4")
|
||||
.to_string_lossy()
|
||||
.into_owned();
|
||||
assert_eq!(f, plain);
|
||||
|
||||
// An existing source embeds a stable per-file identifier.
|
||||
let existing = std::path::Path::new(&temp_subdir("existing")).join("real.mp4");
|
||||
@@ -535,7 +543,7 @@ mod tests {
|
||||
f1.contains("-0.1280x720.v1.a1.mp4"),
|
||||
"size/version/audio tags present: {f1}"
|
||||
);
|
||||
assert!(f1 != format!("{}/proxy/-0.1280x720.v1.a1.mp4", cache), "id embedded: {f1}");
|
||||
assert!(f1 != plain, "id embedded: {f1}");
|
||||
assert_eq!(f1, f2, "the identifier is stable for the same file");
|
||||
|
||||
// Divider mode tags the divider instead of an absolute size.
|
||||
|
||||
Reference in New Issue
Block a user