()
| 35 | } |
| 36 | |
| 37 | func (s *OptionsTestSuite) TestAppendToSlice() { |
| 38 | o := options.New() |
| 39 | o.Set("slice", []int{1, 2, 3}) |
| 40 | |
| 41 | // Append to existing slice |
| 42 | options.AppendToSlice(o, "slice", 4, 5) |
| 43 | s.Require().Equal([]int{1, 2, 3, 4, 5}, options.Get(o, "slice", []int{})) |
| 44 | |
| 45 | // Append to non-existing slice |
| 46 | options.AppendToSlice(o, "new_slice", 10, 20) |
| 47 | s.Require().Equal([]int{10, 20}, options.Get(o, "new_slice", []int{})) |
| 48 | |
| 49 | // Type mismatch |
| 50 | s.Require().Panics(func() { |
| 51 | options.AppendToSlice(o, "slice", "not_an_int") |
| 52 | }) |
| 53 | } |
| 54 | |
| 55 | func (s *OptionsTestSuite) TestSliceContains() { |
| 56 | o := options.New() |
nothing calls this directly
no test coverage detected