Skip to content

Commit

Permalink
fix: add missing TestEnvironment_FromCBOR_instance_only test
Browse files Browse the repository at this point in the history
Signed-off-by: Pranjal Kole <[email protected]>
  • Loading branch information
pranjalkole committed Jan 19, 2025
1 parent e629156 commit ab74087
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions comid/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ func TestEnvironment_FromCBOR_class_and_instance(t *testing.T) {
assert.Nil(t, actual.Group)
}

func TestEnvironment_FromCBOR_instance_only(t *testing.T) {
// {1: 550(h'02DEADBEEFDEAD')}
tv := MustHexDecode(t, "a101d902264702deadbeefdead")

var actual Environment
err := actual.FromCBOR(tv)

assert.Nil(t, err)
assert.Nil(t, actual.Class)
assert.NotNil(t, actual.Instance)
assert.Equal(t, []byte(TestUEID), actual.Instance.Bytes())
assert.Nil(t, actual.Group)
}

func TestEnvironment_FromCBOR_group_only(t *testing.T) {
// {2: 37(h'31FB5ABF023E4992AA4E95F9C1503BFA')}
tv := MustHexDecode(t, "a102d8255031fb5abf023e4992aa4e95f9c1503bfa")
Expand Down

0 comments on commit ab74087

Please sign in to comment.