@@ -35,7 +35,6 @@ func TestDropWhileIntPtr(t *testing.T) {
3535 }
3636}
3737
38-
3938func TestDropWhileInt64Ptr (t * testing.T ) {
4039 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
4140
@@ -65,7 +64,6 @@ func TestDropWhileInt64Ptr(t *testing.T) {
6564 }
6665}
6766
68-
6967func TestDropWhileInt32Ptr (t * testing.T ) {
7068 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
7169
@@ -95,7 +93,6 @@ func TestDropWhileInt32Ptr(t *testing.T) {
9593 }
9694}
9795
98-
9996func TestDropWhileInt16Ptr (t * testing.T ) {
10097 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
10198
@@ -125,7 +122,6 @@ func TestDropWhileInt16Ptr(t *testing.T) {
125122 }
126123}
127124
128-
129125func TestDropWhileInt8Ptr (t * testing.T ) {
130126 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
131127
@@ -155,7 +151,6 @@ func TestDropWhileInt8Ptr(t *testing.T) {
155151 }
156152}
157153
158-
159154func TestDropWhileUintPtr (t * testing.T ) {
160155 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
161156
@@ -185,7 +180,6 @@ func TestDropWhileUintPtr(t *testing.T) {
185180 }
186181}
187182
188-
189183func TestDropWhileUint64Ptr (t * testing.T ) {
190184 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
191185
@@ -215,7 +209,6 @@ func TestDropWhileUint64Ptr(t *testing.T) {
215209 }
216210}
217211
218-
219212func TestDropWhileUint32Ptr (t * testing.T ) {
220213 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
221214
@@ -245,7 +238,6 @@ func TestDropWhileUint32Ptr(t *testing.T) {
245238 }
246239}
247240
248-
249241func TestDropWhileUint16Ptr (t * testing.T ) {
250242 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
251243
@@ -275,7 +267,6 @@ func TestDropWhileUint16Ptr(t *testing.T) {
275267 }
276268}
277269
278-
279270func TestDropWhileUint8Ptr (t * testing.T ) {
280271 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
281272
@@ -305,35 +296,32 @@ func TestDropWhileUint8Ptr(t *testing.T) {
305296 }
306297}
307298
299+ func TestDropWhileStrPtr (t * testing.T ) {
300+ // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
301+
302+ var v2 string = "2"
303+ var v3 string = "3"
304+ var v4 string = "4"
305+ var v5 string = "5"
308306
307+ expectedNewList := []* string {& v3 , & v4 , & v5 }
308+ NewList := DropWhileStrPtr (isEvenStrPtr , []* string {& v4 , & v2 , & v3 , & v4 , & v5 })
309+ if * NewList [0 ] != * expectedNewList [0 ] || * NewList [1 ] != * expectedNewList [1 ] || * NewList [2 ] != * expectedNewList [2 ] {
310+ t .Errorf ("DropWhileStrPtr failed. Expected New list=%v, actual list=%v" , expectedNewList , NewList )
311+ }
309312
310- func TestDropWhileStrPtr (t * testing.T ) {
311- // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
312-
313- var v2 string = "2"
314- var v3 string = "3"
315- var v4 string = "4"
316- var v5 string = "5"
317-
318- expectedNewList := []* string {& v3 , & v4 , & v5 }
319- NewList := DropWhileStrPtr (isEvenStrPtr , []* string {& v4 , & v2 , & v3 , & v4 , & v5 })
320- if * NewList [0 ] != * expectedNewList [0 ] || * NewList [1 ] != * expectedNewList [1 ] || * NewList [2 ] != * expectedNewList [2 ] {
321- t .Errorf ("DropWhileStrPtr failed. Expected New list=%v, actual list=%v" , expectedNewList , NewList )
322- }
323-
324- if len (DropWhileStrPtr (nil , nil )) > 0 {
325- t .Errorf ("DropWhileStrPtr failed." )
326- }
327-
328- if len (DropWhileStrPtr (nil , []* string {})) > 0 {
329- t .Errorf ("DropWhileStrPtr failed." )
330- }
331- NewList = DropWhileStrPtr (isEvenStrPtr , []* string {& v4 })
332- if len (NewList ) != 0 {
333- t .Errorf ("DropWhileStrPtr failed" )
334- }
313+ if len (DropWhileStrPtr (nil , nil )) > 0 {
314+ t .Errorf ("DropWhileStrPtr failed." )
335315 }
336316
317+ if len (DropWhileStrPtr (nil , []* string {})) > 0 {
318+ t .Errorf ("DropWhileStrPtr failed." )
319+ }
320+ NewList = DropWhileStrPtr (isEvenStrPtr , []* string {& v4 })
321+ if len (NewList ) != 0 {
322+ t .Errorf ("DropWhileStrPtr failed" )
323+ }
324+ }
337325
338326func TestDropWhileBoolPtr (t * testing.T ) {
339327 var vt bool = true
@@ -346,7 +334,6 @@ func TestDropWhileBoolPtr(t *testing.T) {
346334 }
347335}
348336
349-
350337func TestDropWhileFloat32Ptr (t * testing.T ) {
351338 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
352339
@@ -376,7 +363,6 @@ func TestDropWhileFloat32Ptr(t *testing.T) {
376363 }
377364}
378365
379-
380366func TestDropWhileFloat64Ptr (t * testing.T ) {
381367 // Test : drop the numbers as long as condition match and returns remaining number in the list once condition fails
382368
@@ -405,4 +391,3 @@ func TestDropWhileFloat64Ptr(t *testing.T) {
405391 t .Errorf ("DropWhileFloat64Ptr failed" )
406392 }
407393}
408-
0 commit comments