mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-11-07 09:46:03 -10:00
* chore(deps): strip dependencies Signed-off-by: Dwi Siswanto <[email protected]> * chore: drop stripped dependencies Signed-off-by: Dwi Siswanto <[email protected]> * tests(integration): reduce external service flakiness Signed-off-by: Dwi Siswanto <[email protected]> * refactor(types): replace govalidator ASCII check Signed-off-by: Dwi Siswanto <[email protected]> * chore(trackers): update go-github import path Signed-off-by: Dwi Siswanto <[email protected]> * chore: use our PD wrapper Signed-off-by: Dwi Siswanto <[email protected]> * chore: use our PD cache packages Signed-off-by: Dwi Siswanto <[email protected]> * chore(utils): use x/net publicsuffix Signed-off-by: Dwi Siswanto <[email protected]> * chore(input): decode YAML without invopop/yaml Signed-off-by: Dwi Siswanto <[email protected]> * refactor(yaml): route callers through pkg/utils/yaml Signed-off-by: Dwi Siswanto <[email protected]> * refactor(json): route callers through pkg/utils/json Signed-off-by: Dwi Siswanto <[email protected]> * refactpr(scan): replace Echo handlers with net/http Signed-off-by: Dwi Siswanto <[email protected]> * refactor(server): replace Echo with net/http Signed-off-by: Dwi Siswanto <[email protected]> * refactor(fuzzplayground): replace Echo server with net/http Signed-off-by: Dwi Siswanto <[email protected]> * test: update subdomains testdata Signed-off-by: Dwi Siswanto <[email protected]> * chore(yaml): satisfy lints Signed-off-by: Dwi Siswanto <[email protected]> * fix codeql --------- Signed-off-by: Dwi Siswanto <[email protected]> Co-authored-by: Mzack9999 <[email protected]>
25 lines
560 B
Go
25 lines
560 B
Go
package utils
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/utils/yaml"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
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")
|
|
}
|