Skip to content

Commit 6f73c39

Browse files
authored
Merge pull request #93 from samply/develop
bump main to v0.3.0
2 parents d916132 + 9178844 commit 6f73c39

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "focus"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition = "2021"
55
license = "Apache-2.0"
66

src/main.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type BeamResult = TaskResult<beam_lib::RawString>;
4141
#[derive(Debug, Deserialize, Serialize, Clone)]
4242
struct Metadata {
4343
project: String,
44+
#[serde(default)]
4445
execute: bool,
4546
}
4647

@@ -463,3 +464,22 @@ fn beam_result(task: BeamTask, measure_report: String) -> Result<BeamResult, Foc
463464
data,
464465
))
465466
}
467+
468+
mod test {
469+
use super::*;
470+
471+
const METADATA_STRING : &str = "{\"project\": \"exliquid\"}";
472+
473+
#[test]
474+
fn test_metadata_deserialization_default() {
475+
476+
let metadata: Metadata = serde_json::from_str(METADATA_STRING).unwrap_or(Metadata {
477+
project: "default_obfuscation".to_string(),
478+
execute: true,
479+
});
480+
481+
assert!(!metadata.execute);
482+
483+
}
484+
485+
}

0 commit comments

Comments
 (0)