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

Method TestSubsection_AddOption

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

Source from the content-addressed store, hash-verified

264}
265
266func (s *SectionSuite) TestSubsection_AddOption(c *C) {
267 sect := &Subsection{
268 Options: []*Option{
269 {"key1", "value1"},
270 },
271 }
272 sect1 := &Subsection{
273 Options: []*Option{
274 {"key1", "value1"},
275 {"key2", "value2"},
276 },
277 }
278 c.Assert(sect.AddOption("key2", "value2"), DeepEquals, sect1)
279
280 sect2 := &Subsection{
281 Options: []*Option{
282 {"key1", "value1"},
283 {"key2", "value2"},
284 {"key1", "value3"},
285 },
286 }
287 c.Assert(sect.AddOption("key1", "value3"), DeepEquals, sect2)
288}
289
290func (s *SectionSuite) TestSubsection_SetOption(c *C) {
291 sect := &Subsection{

Callers

nothing calls this directly

Calls 1

AddOptionMethod · 0.95

Tested by

no test coverage detected