File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed
pixi-build-rattler-build/src Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,22 @@ use serde::Deserialize;
5
5
#[ serde( rename_all = "kebab-case" ) ]
6
6
pub struct CMakeBackendConfig {
7
7
/// Extra args for CMake invocation
8
+ #[ serde( default ) ]
8
9
pub extra_args : Vec < String > ,
9
10
/// Environment Variables
11
+ #[ serde( default ) ]
10
12
pub env : IndexMap < String , String > ,
11
13
}
14
+
15
+ #[ cfg( test) ]
16
+ mod tests {
17
+ use serde_json:: json;
18
+
19
+ use super :: CMakeBackendConfig ;
20
+
21
+ #[ test]
22
+ fn test_ensure_deseralize_from_empty ( ) {
23
+ let json_data = json ! ( { } ) ;
24
+ serde_json:: from_value :: < CMakeBackendConfig > ( json_data) . unwrap ( ) ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ pub struct PythonBackendConfig {
11
11
pub noarch : Option < bool > ,
12
12
13
13
/// Environment Variables
14
+ #[ serde( default ) ]
14
15
pub env : IndexMap < String , String > ,
15
16
}
16
17
@@ -20,3 +21,15 @@ impl PythonBackendConfig {
20
21
self . noarch . map_or ( true , identity)
21
22
}
22
23
}
24
+
25
+ #[ cfg( test) ]
26
+ mod tests {
27
+ use super :: PythonBackendConfig ;
28
+ use serde_json:: json;
29
+
30
+ #[ test]
31
+ fn test_ensure_deseralize_from_empty ( ) {
32
+ let json_data = json ! ( { } ) ;
33
+ serde_json:: from_value :: < PythonBackendConfig > ( json_data) . unwrap ( ) ;
34
+ }
35
+ }
Original file line number Diff line number Diff line change @@ -6,3 +6,15 @@ use std::path::PathBuf;
6
6
pub struct RattlerBuildBackendConfig {
7
7
pub debug_dir : Option < PathBuf > ,
8
8
}
9
+
10
+ #[ cfg( test) ]
11
+ mod tests {
12
+ use super :: RattlerBuildBackendConfig ;
13
+ use serde_json:: json;
14
+
15
+ #[ test]
16
+ fn test_ensure_deseralize_from_empty ( ) {
17
+ let json_data = json ! ( { } ) ;
18
+ serde_json:: from_value :: < RattlerBuildBackendConfig > ( json_data) . unwrap ( ) ;
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -6,8 +6,22 @@ use serde::Deserialize;
6
6
#[ serde( rename_all = "kebab-case" ) ]
7
7
pub struct RustBackendConfig {
8
8
/// Extra args to pass for cargo
9
+ #[ serde( default ) ]
9
10
pub extra_args : Vec < String > ,
10
11
11
12
/// Environment Variables
13
+ #[ serde( default ) ]
12
14
pub env : IndexMap < String , String > ,
13
15
}
16
+
17
+ #[ cfg( test) ]
18
+ mod tests {
19
+ use super :: RustBackendConfig ;
20
+ use serde_json:: json;
21
+
22
+ #[ test]
23
+ fn test_ensure_deseralize_from_empty ( ) {
24
+ let json_data = json ! ( { } ) ;
25
+ serde_json:: from_value :: < RustBackendConfig > ( json_data) . unwrap ( ) ;
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments