Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Dec 4, 2024
1 parent c4ace54 commit 0c18539
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/wasm-metadata/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl Metadata {
Metadata::Component {
name: None,
producers: None,
author: None,
registry_metadata: None,
children: Vec::new(),
range,
Expand All @@ -134,6 +135,7 @@ impl Metadata {
Metadata::Module {
name: None,
producers: None,
author: None,
registry_metadata: None,
range,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/wasm-metadata/src/oci_annotations/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use wasmparser::CustomSectionReader;

/// Contact details of the people or organization responsible for the image
/// encoded as a freeform string.
#[derive(Debug, PartialEq)]
#[derive(Debug)]
pub struct Author(CustomSection<'static>);

impl Serialize for Author {
Expand Down
6 changes: 6 additions & 0 deletions crates/wasm-metadata/tests/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fn add_to_empty_component() {
name,
producers,
registry_metadata,
author,
children,
range,
} => {
Expand Down Expand Up @@ -98,6 +99,8 @@ fn add_to_empty_component() {
vec!["Tools".to_owned()]
);

assert!(author.is_none());

assert_eq!(range.start, 0);
assert_eq!(range.end, 435);
}
Expand Down Expand Up @@ -159,6 +162,7 @@ fn add_to_nested_component() {
Metadata::Module {
name,
producers,
author,
registry_metadata,
range,
} => {
Expand All @@ -179,6 +183,8 @@ fn add_to_nested_component() {
&["Foo".to_owned()]
);

assert!(author.is_none());

assert_eq!(range.start, 10);
assert_eq!(range.end, 123);
}
Expand Down
3 changes: 3 additions & 0 deletions crates/wasm-metadata/tests/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn add_to_empty_module() {
Metadata::Module {
name,
producers,
author,
registry_metadata,
range,
} => {
Expand Down Expand Up @@ -96,6 +97,8 @@ fn add_to_empty_module() {
vec!["Tools".to_owned()]
);

assert!(author.is_none());

assert_eq!(range.start, 0);
assert_eq!(range.end, 425);
}
Expand Down

0 comments on commit 0c18539

Please sign in to comment.