Skip to content

Commit 1efff4e

Browse files
committed
add test for HasParamSpec
1 parent 7142f88 commit 1efff4e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

glib/src/param_spec.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,4 +2025,20 @@ mod tests {
20252025
assert_eq!(pspec.minimum(), -2);
20262026
assert_eq!(pspec.flags(), ParamFlags::READWRITE);
20272027
}
2028+
2029+
#[test]
2030+
fn test_has_param_spec() {
2031+
let pspec = <i32 as HasParamSpec>::param_spec_builder()("name")
2032+
.blurb("Simple int parameter")
2033+
.minimum(-2)
2034+
.explicit_notify()
2035+
.build();
2036+
2037+
assert_eq!(pspec.name(), "name");
2038+
assert_eq!(pspec.blurb(), Some("Simple int parameter"));
2039+
assert_eq!(
2040+
pspec.flags(),
2041+
ParamFlags::READWRITE
2042+
);
2043+
}
20282044
}

0 commit comments

Comments
 (0)