mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
fix bug
This commit is contained in:
24
maps/sorted_map_test.go
Normal file
24
maps/sorted_map_test.go
Normal file
@ -0,0 +1,24 @@
|
||||
package maps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSortMapConvert(t *testing.T) {
|
||||
var m = NewSortedMap(map[string]any{"aaa": "bbb"}).Asc()
|
||||
|
||||
var c Map[string, any] = m
|
||||
|
||||
t.Log(Join(c, " ", func(k string, v any) string {
|
||||
return fmt.Sprintf("%s=%v", k, v)
|
||||
}))
|
||||
}
|
||||
|
||||
func TestSortedJoin(t *testing.T) {
|
||||
var m = NewSortedMap(map[string]any{"b": "b", "a": "a", "d": "d", "c": "c"}).Asc()
|
||||
|
||||
t.Log(Join[string, any](m, "&", func(k string, v any) string {
|
||||
return fmt.Sprintf("%s=%v", k, v)
|
||||
}))
|
||||
}
|
Reference in New Issue
Block a user