github.com/vchain-us/vcn@v0.9.11-0.20210921212052-a2484d23c0b3/pkg/cmd/sign/opts_test.go (about)

     1  /*
     2   * Copyright (c) 2018-2020 vChain, Inc. All Rights Reserved.
     3   * This software is released under GPL3.
     4   * The full license information can be found under:
     5   * https://www.gnu.org/licenses/gpl-3.0.en.html
     6   *
     7   */
     8  
     9  package sign
    10  
    11  import (
    12  	"testing"
    13  
    14  	"github.com/stretchr/testify/assert"
    15  )
    16  
    17  func TestMapOpts(t *testing.T) {
    18  	m := mapOpts{}
    19  
    20  	err := m.Set("key=value")
    21  	assert.NoError(t, err)
    22  
    23  	assert.Equal(t, mapOpts{"key": "value"}, m)
    24  	assert.Equal(t, `{"key":"value"}`, m.String())
    25  	assert.Equal(t, map[string]interface{}{"key": "value"}, m.StringToInterface())
    26  }