(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestOptionalPropKey(t *testing.T) { |
| 87 | for i := 0; i < OptPropsCnt; i++ { |
| 88 | key := OptionalEvalPropKey(i) |
| 89 | keySet := key.AsPropKeySet() |
| 90 | // keySet should contain the specified key |
| 91 | require.True(t, keySet.Contains(key)) |
| 92 | // desc in optionalPropertyDescList should be the same with key.Desc() |
| 93 | require.Equal(t, key, optionalPropertyDescList[i].Key()) |
| 94 | require.Same(t, &optionalPropertyDescList[i], key.Desc()) |
| 95 | // keySet should not contain other keys |
| 96 | for j := 0; j < OptPropsCnt; j++ { |
| 97 | if i != j { |
| 98 | key2 := OptionalEvalPropKey(j) |
| 99 | require.False(t, keySet.Contains(key2)) |
| 100 | } |
| 101 | } |
| 102 | // If key removed from the keySet, the keySet should be empty |
| 103 | keySet = keySet.Remove(key) |
| 104 | require.True(t, keySet.IsEmpty()) |
| 105 | } |
| 106 | } |
nothing calls this directly
no test coverage detected