Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
keks committed Sep 19, 2024
1 parent c257ef6 commit daf7f46
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion openmls/src/group/tests_and_kats/tests/group.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{framing::*, group::*, test_utils::*, *};
use mls_group::tests_and_kats::utils::{setup_alice_bob, setup_alice_bob_group, setup_client};
use treesync::LeafNodeParameters;
use treesync::{node::leaf_node::Capabilities, LeafNodeParameters};

#[openmls_test::openmls_test]
fn create_commit_optional_path(
Expand Down Expand Up @@ -104,6 +104,41 @@ fn basic_group_setup() {
};
}

#[openmls_test::openmls_test]
fn wrong_group_create_config() {
MlsGroupCreateConfig::builder()
.with_leaf_node_extensions(Extensions::single(Extension::Unknown(
0xff00,
UnknownExtension(b"testdata".to_vec()),
)))
.expect_err("leaf node extension is not in leaf node capabilities, should have failed");

MlsGroupCreateConfig::builder()
.capabilities(
Capabilities::builder()
.extensions(vec![ExtensionType::Unknown(0xff00)])
.build(),
)
.with_leaf_node_extensions(Extensions::single(Extension::Unknown(
0xff01,
UnknownExtension(b"testdata".to_vec()),
)))
.expect_err("leaf node extension is not in leaf node capabilities, should have failed");

MlsGroupCreateConfig::builder()
.capabilities(
Capabilities::builder()
.extensions(vec![ExtensionType::Unknown(0xff00)])
.build(),
)
.with_leaf_node_extensions(Extensions::single(Extension::Unknown(
0xff00,
UnknownExtension(b"testdata".to_vec()),
)))
.expect("leaf node extension is in leaf node capabilities, should have succeeded")
.build();
}

/// This test simulates various group operations like Add, Update, Remove in a
/// small group
/// - Alice creates a group
Expand Down

0 comments on commit daf7f46

Please sign in to comment.