@@ -156,6 +156,7 @@ def test_iterable_str_to_array_1d_int_13(self) -> None:
156
156
with self .assertRaises (TypeError ):
157
157
a1 = iterable_str_to_array_1d (['3.000' , '4.000' , '1.000' ], dtype = int , thousandschar = ',' )
158
158
159
+
159
160
#---------------------------------------------------------------------------
160
161
161
162
def test_iterable_str_to_array_1d_uint_1 (self ) -> None :
@@ -703,6 +704,42 @@ def test_delimited_to_arrays_parse_i(self) -> None:
703
704
post2 = delimited_to_arrays (msg , axis = 1 , skipinitialspace = True )
704
705
self .assertEqual ([a .tolist () for a in post2 ], [['a' , 'b' ], [10 , 20 ], ['foo' , 'c' ]])
705
706
707
+ def test_delimited_to_arrays_parse_j (self ) -> None :
708
+ msg = [
709
+ '2021,2021-04-01,4' ,
710
+ '2022,2022-05-01,3' ,
711
+ ]
712
+ post1 = delimited_to_arrays (msg , axis = 1 , skipinitialspace = False )
713
+ self .assertEqual ([a .tolist () for a in post1 ], [[2021 , 2022 ], ['2021-04-01' , '2022-05-01' ], [4 , 3 ]])
714
+
715
+
716
+ def test_delimited_to_arrays_parse_k (self ) -> None :
717
+ msg = [
718
+ '2021,2021-04,4' ,
719
+ '2022,2022-05,3' ,
720
+ ]
721
+ post1 = delimited_to_arrays (msg , axis = 1 , skipinitialspace = False )
722
+ self .assertEqual ([a .tolist () for a in post1 ], [[2021 , 2022 ], ['2021-04' , '2022-05' ], [4 , 3 ]])
723
+
724
+
725
+ def test_delimited_to_arrays_parse_l (self ) -> None :
726
+ msg = [
727
+ '1,2,3' ,
728
+ '2-,2-0,-3' ,
729
+ ]
730
+ post1 = delimited_to_arrays (msg , axis = 1 , skipinitialspace = False )
731
+ self .assertEqual ([a .tolist () for a in post1 ], [['1' , '2-' ], ['2' , '2-0' ], [3 , - 3 ]])
732
+
733
+ def test_delimited_to_arrays_parse_m (self ) -> None :
734
+ msg = [
735
+ ' 1, 2,3' ,
736
+ ' 2-, 2-0, -3' ,
737
+ ]
738
+ post1 = delimited_to_arrays (msg , axis = 1 , skipinitialspace = False )
739
+ self .assertEqual ([a .tolist () for a in post1 ], [[' 1' , ' 2-' ], [' 2' , ' 2-0' ], [3 , - 3 ]])
740
+
741
+
742
+ # import ipdb; ipdb.set_trace()
706
743
707
744
#---------------------------------------------------------------------------
708
745
def test_delimited_to_arrays_float_a (self ) -> None :
0 commit comments