File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
qs-kotlin/src/test/kotlin/io/github/techouse/qskotlin/unit/internal Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,27 @@ class EncoderInternalSpec :
115115 result.shouldBeInstanceOf<String >()
116116 result shouldBe " ts=X2024-05-01"
117117 }
118+
119+ it(" pre-encodes comma lists when encodeValuesOnly is true" ) {
120+ val seenValues = mutableListOf<String >()
121+ val result =
122+ Encoder .encode(
123+ data = listOf (" alpha" ),
124+ undefined = false ,
125+ sideChannel = mutableMapOf (),
126+ prefix = " tags" ,
127+ generateArrayPrefix = ListFormat .COMMA .generator,
128+ encodeValuesOnly = true ,
129+ encoder = { value, _, _ ->
130+ val text = value?.toString() ? : " "
131+ seenValues + = text
132+ " enc:$text "
133+ },
134+ )
135+
136+ seenValues shouldBe listOf (" alpha" )
137+ result shouldBe listOf (" tags[]=enc:alpha" )
138+ }
118139 }
119140 })
120141
You can’t perform that action at this time.
0 commit comments