File tree Expand file tree Collapse file tree 3 files changed +12
-39
lines changed Expand file tree Collapse file tree 3 files changed +12
-39
lines changed Original file line number Diff line number Diff line change 137137 m[4 ] = 14
138138 @test m. data === (11 , 12 , 13 , 14 )
139139
140+ m = @MMatrix [0 0 ; 0 0 ]
141+ m[1 ] = Int8 (11 )
142+ m[2 ] = Int8 (12 )
143+ m[3 ] = Int8 (13 )
144+ m[4 ] = Int8 (14 )
145+ @test m. data === (11 , 12 , 13 , 14 )
146+
147+ v = @MVector [1. ,2. ,3. ]
148+ v[1 ] = Float16 (11 )
149+ @test v. data === (11. , 2. , 3. )
150+
151+ v = @MArray [1 ,2 ,3 ]
140152 @test_throws BoundsError setindex! (v, 4 , - 1 )
141153 mm = @MArray zeros (3 ,3 ,3 ,3 )
142154 @test_throws BoundsError setindex! (mm, 4 , - 1 )
Original file line number Diff line number Diff line change 8989
9090 @test length (m) === 4
9191 end
92-
93- @testset " setindex!" begin
94- m = @MMatrix [0 0 ; 0 0 ]
95- m[1 ] = 11
96- m[2 ] = 12
97- m[3 ] = 13
98- m[4 ] = 14
99- @test m. data === (11 , 12 , 13 , 14 )
100-
101- m = @MMatrix [0 0 ; 0 0 ]
102- m[1 ] = Int8 (11 )
103- m[2 ] = Int8 (12 )
104- m[3 ] = Int8 (13 )
105- m[4 ] = Int8 (14 )
106- @test m. data === (11 , 12 , 13 , 14 )
107-
108- # setindex with non-elbits type
109- m = MMatrix {2,2,String} (undef)
110- @test_throws ErrorException setindex! (m, " a" , 1 , 1 )
111- end
11292end
Original file line number Diff line number Diff line change 6969
7070 @test length (v) === 3
7171 end
72-
73- @testset " setindex!" begin
74- v = @MVector [1 ,2 ,3 ]
75- v[1 ] = 11
76- v[2 ] = 12
77- v[3 ] = 13
78- @test v. data === (11 , 12 , 13 )
79-
80- v = @MVector [1. ,2. ,3. ]
81- v[1 ] = Float16 (11 )
82- @test v. data === (11. , 2. , 3. )
83-
84- @test_throws BoundsError setindex! (v, 4. , - 1 )
85- @test_throws BoundsError setindex! (v, 4. , 4 )
86-
87- # setindex with non-elbits type
88- v = MVector {2,String} (undef)
89- @test_throws ErrorException setindex! (v, " a" , 1 )
90- end
9172end
You can’t perform that action at this time.
0 commit comments