@@ -125,6 +125,27 @@ func TestDataSources(t *testing.T) { // lint:allow_complexity
125125 terraform .Output (t , terraformOptions , "str_contains_ds" ),
126126 strconv .FormatBool (corefunc .StrContains ("Hello world!" , "ello" )),
127127 )
128+
129+ assert .Equal (
130+ t ,
131+ terraform .Output (t , terraformOptions , "str_byte_length1_ds" ),
132+ strconv .FormatInt (int64 (corefunc .StrByteLength ("abcde" )), 10 ),
133+ )
134+ assert .Equal (
135+ t ,
136+ terraform .Output (t , terraformOptions , "str_byte_length2_ds" ),
137+ strconv .FormatInt (int64 (corefunc .StrByteLength ("♫" )), 10 ),
138+ )
139+ assert .Equal (
140+ t ,
141+ terraform .Output (t , terraformOptions , "str_byte_length3_ds" ),
142+ strconv .FormatInt (int64 (corefunc .StrByteLength ("界" )), 10 ),
143+ )
144+ assert .Equal (
145+ t ,
146+ terraform .Output (t , terraformOptions , "str_byte_length4_ds" ),
147+ strconv .FormatInt (int64 (corefunc .StrByteLength ("スター☆" )), 10 ),
148+ )
128149 })
129150
130151 // Format shifting
@@ -294,6 +315,27 @@ func TestDataSources(t *testing.T) { // lint:allow_complexity
294315 terraform .Output (t , terraformOptions , "time_parse3_ds" ),
295316 strconv .FormatFloat (float64 (timestamp ), 'e' , 9 , 64 ),
296317 )
318+
319+ result , err := corefunc .TimeCompare ("2006-01-02T15:04:05Z" , "Mon, 02 Jan 2006 15:04:05 GMT" )
320+ if err != nil {
321+ t .Fatal (err )
322+ }
323+
324+ assert .Equal (t , terraform .Output (t , terraformOptions , "time_compare1_ds" ), strconv .Itoa (result ))
325+
326+ result , err = corefunc .TimeCompare ("Monday, 02-Jan-2006 15:04:05 MST" , "2007-01-02T15:04:05Z" )
327+ if err != nil {
328+ t .Fatal (err )
329+ }
330+
331+ assert .Equal (t , terraform .Output (t , terraformOptions , "time_compare2_ds" ), strconv .Itoa (result ))
332+
333+ result , err = corefunc .TimeCompare ("2007-01-02T15:04:05Z" , "Monday, 02-Jan-2006 15:04:05 MST" )
334+ if err != nil {
335+ t .Fatal (err )
336+ }
337+
338+ assert .Equal (t , terraform .Output (t , terraformOptions , "time_compare3_ds" ), strconv .Itoa (result ))
297339 })
298340
299341 // Hashing
0 commit comments