@@ -21,15 +21,27 @@ func TestService_SerializeEventData(t *testing.T) {
2121 }{
2222 {
2323 fields : map [string ]interface {}{"primitive_type" : 10 },
24- expBody : "{\" app_key\" :\" key\" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" primitive_type\" :10,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
24+ expBody : "{\" app_key\" :\" key\" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" primitive_type\" :\" 10\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
25+ },
26+ {
27+ fields : map [string ]interface {}{"primitive_type" : "string" },
28+ expBody : "{\" app_key\" :\" key\" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" primitive_type\" :\" string\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
29+ },
30+ {
31+ fields : map [string ]interface {}{"primitive_type" : true },
32+ expBody : "{\" app_key\" :\" key\" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" primitive_type\" :\" true\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
33+ },
34+ {
35+ fields : map [string ]interface {}{"primitive_type" : 123.45 },
36+ expBody : "{\" app_key\" :\" key\" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" primitive_type\" :\" 123.45\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
2537 },
2638 {
2739 fields : map [string ]interface {}{"escape" : "\n " },
2840 expBody : "{\" app_key\" :\" key\" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" escape\" :\" \\ n\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
2941 },
3042 {
3143 fields : map [string ]interface {}{"array" : []interface {}{10 , true , "string value" }},
32- expBody : "{\" app_key\" :\" key\" ,\" array\" :[10,true,\" string value\" ] ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
44+ expBody : "{\" app_key\" :\" key\" ,\" array\" :\" [10,true,\\ \ " string value\\ \" ] \" ,\" check\" :\" id\" ,\" description\" :\" message\" ,\" details\" :\" details\" ,\" status\" :\" ok\" ,\" task\" :\" :test\" ,\" timestamp\" :31536038}\n " ,
3345 },
3446 }
3547
0 commit comments