...

Source file src/github.com/clbanning/mxj/v2/remove_test.go

Documentation: github.com/clbanning/mxj/v2

     1  package mxj
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestRemove(t *testing.T) {
     8  	m := map[string]interface{}{
     9  		"Div": map[string]interface{}{
    10  			"Colour": "blue",
    11  		},
    12  	}
    13  	mv := Map(m)
    14  	err := mv.Remove("Div.Colour")
    15  	if err != nil {
    16  		t.Fatal(err)
    17  	}
    18  	if v, _ := mv.Exists("Div.Colour"); v {
    19  		t.Fatal("removed key still remain")
    20  	}
    21  }
    22  

View as plain text