Skip to content

Commit

Permalink
Merge pull request #93 from samply/develop
Browse files Browse the repository at this point in the history
bump main to v0.3.0
  • Loading branch information
lablans authored Dec 22, 2023
2 parents d916132 + 9178844 commit 6f73c39
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "focus"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
license = "Apache-2.0"

Expand Down
20 changes: 20 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type BeamResult = TaskResult<beam_lib::RawString>;
#[derive(Debug, Deserialize, Serialize, Clone)]
struct Metadata {
project: String,
#[serde(default)]
execute: bool,
}

Expand Down Expand Up @@ -463,3 +464,22 @@ fn beam_result(task: BeamTask, measure_report: String) -> Result<BeamResult, Foc
data,
))
}

mod test {
use super::*;

const METADATA_STRING : &str = "{\"project\": \"exliquid\"}";

#[test]
fn test_metadata_deserialization_default() {

let metadata: Metadata = serde_json::from_str(METADATA_STRING).unwrap_or(Metadata {
project: "default_obfuscation".to_string(),
execute: true,
});

assert!(!metadata.execute);

}

}

0 comments on commit 6f73c39

Please sign in to comment.