Skip to content
Snippets Groups Projects
Select Git revision
  • 1b4021d0dacaacc8c8670ead0a535c84279cc96b
  • master default protected
  • v1.22.9
  • v1.22.8
  • v1.22.7
  • v1.22.6
  • v1.22.5
  • v1.22.4
  • v1.22.3
  • v1.22.1
  • v1.22.0
  • v1.21.0
  • v1.20.5
  • v1.20.4
  • v1.20.3
  • v1.20.2
  • v1.20.1
  • v1.20.0
  • v1.19.0
  • v1.18.3
  • v1.18.2
  • v1.18.1
22 results

copyable_test.go

Blame
  • copyable_test.go 489 B
    // Copyright 2022 schukai GmbH
    // SPDX-License-Identifier: AGPL-3.0
    
    package configuration
    
    import (
    	"github.com/stretchr/testify/assert"
    	"testing"
    )
    
    func TestCopyable(t *testing.T) {
    	config := struct {
    		Host string
    		Port int
    	}{
    		Host: "localhost",
    		Port: 8080,
    	}
    
    	c := New(config)
    
    	assert.Equal(t, c.Config().Host, "localhost")
    	assert.Equal(t, c.Config().Port, 8080)
    
    	m := map[string]any{
    		"Host": "1.2.3.4",
    	}
    
    	c.Copy(m)
    
    	assert.Equal(t, c.Config().Host, "1.2.3.4")
    
    }