MCPcopy Create free account
hub / github.com/go-git/go-git / TestSubsection_SetOption

Method TestSubsection_SetOption

plumbing/format/config/section_test.go:290–307  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

288}
289
290func (s *SectionSuite) TestSubsection_SetOption(c *C) {
291 sect := &Subsection{
292 Options: []*Option{
293 {Key: "key1", Value: "value1"},
294 {Key: "key2", Value: "value2"},
295 {Key: "key1", Value: "value3"},
296 },
297 }
298
299 expected := &Subsection{
300 Options: []*Option{
301 {Key: "key1", Value: "value1"},
302 {Key: "key2", Value: "value2"},
303 {Key: "key1", Value: "value4"},
304 },
305 }
306 c.Assert(sect.SetOption("key1", "value1", "value4"), DeepEquals, expected)
307}
308
309func (s *SectionSuite) TestSubsection_RemoveOption(c *C) {
310 sect := &Subsection{

Callers

nothing calls this directly

Calls 1

SetOptionMethod · 0.95

Tested by

no test coverage detected