mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 04:04:00 -06:00
31 lines
500 B
Go
31 lines
500 B
Go
package sims
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestSimulationUtils(t *testing.T) {
|
|
a := map[string]any{
|
|
"hello": "world",
|
|
"bool": true,
|
|
"number": 10,
|
|
}
|
|
|
|
err := updateConfigObjectFromJSON(&a, map[string]any{
|
|
"bool": false,
|
|
"number": 5,
|
|
})
|
|
require.NoError(t, err)
|
|
|
|
cfg, err := json.MarshalIndent(a, "", " ")
|
|
require.NoError(t, err)
|
|
require.JSONEq(t, `{
|
|
"hello": "world",
|
|
"bool": false,
|
|
"number": 5
|
|
}`, string(cfg))
|
|
}
|