An empty element without xsi:nil is an empty string, not a null value.
(t *testing.T)
| 45 | |
| 46 | // An empty element without xsi:nil is an empty string, not a null value. |
| 47 | func TestAttributeValueEmptyIsNotNil(t *testing.T) { |
| 48 | got := attributeValueParse(t, `<saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Name="a"><saml:AttributeValue/></saml:Attribute>`) |
| 49 | assert.Check(t, !got.Nil) |
| 50 | assert.Check(t, is.Equal("", got.Value)) |
| 51 | |
| 52 | el := (&AttributeValue{}).Element() |
| 53 | assert.Check(t, el.SelectAttr("xsi:nil") == nil) |
| 54 | } |
| 55 | |
| 56 | func TestAttributeValueNilRoundTrip(t *testing.T) { |
| 57 | // Value is ignored for a null value: the element MUST be empty. |
nothing calls this directly
no test coverage detected