Skip to content

Commit 2cb95e6

Browse files
committed
Add macOS-specific test surface creation and adjust imports
Introduced a macOS-specific `create_test_surface` function in `plotly_kaleido` and adjusted test-related imports in `plotly`. Ensures compatibility with macOS while keeping non-macOS logic intact.
1 parent 70f9d80 commit 2cb95e6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

plotly/src/plot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,12 @@ impl PartialEq for Plot {
584584

585585
#[cfg(test)]
586586
mod tests {
587-
use serde_json::{json, to_value};
588-
use std::path::PathBuf;
589-
590587
use super::*;
591588
use crate::Scatter;
592-
589+
#[cfg(not(target_os = "macos"))]
590+
use base64::engine::general_purpose;
591+
use serde_json::{json, to_value};
592+
use std::path::PathBuf;
593593
fn create_test_plot() -> Plot {
594594
let trace1 = Scatter::new(vec![0, 1, 2], vec![6, 10, 2]).name("trace1");
595595
let mut plot = Plot::new();

plotly_kaleido/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ mod tests {
300300
.unwrap()
301301
}
302302

303+
#[cfg(target_os = "macos")]
303304
fn create_test_surface() -> Value {
304305
to_value(json!({
305306
"data": [

0 commit comments

Comments
 (0)