mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 22:35:27 +00:00
* use parsed options while signing * update project layout to v3 * fix .gitignore * remove example template * misc updates * bump tlsx version * hide template sig warning with env * js: retain value while using log * fix nil pointer derefernce * misc doc update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
25 lines
524 B
Go
25 lines
524 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"gopkg.in/yaml.v2"
|
|
)
|
|
|
|
func TestUnmarshalInsertionOrderedMapYAML(t *testing.T) {
|
|
var data = `a1: test
|
|
a2: value
|
|
a3: new`
|
|
|
|
var value InsertionOrderedStringMap
|
|
err := yaml.Unmarshal([]byte(data), &value)
|
|
require.NoError(t, err, "could not unmarshal map")
|
|
|
|
var items []string
|
|
value.ForEach(func(key string, value interface{}) {
|
|
items = append(items, key)
|
|
})
|
|
require.Equal(t, []string{"a1", "a2", "a3"}, items, "could not get ordered keys")
|
|
}
|