Skip to content

Commit 53e3d5c

Browse files
author
Enric Sala
committed
Format the test data as columns instead of rows
Reflects real use case, because data columns are more common
1 parent 655792e commit 53e3d5c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/SeriesTest.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
methods(TestMethodSetup)
88
function setup(test)
9-
timestamps = [1529933525520, 1529933581618];
9+
timestamps = [1529933525520; 1529933581618];
1010
test.Time = datetime(timestamps / 1000, 'ConvertFrom', 'posixtime');
11-
test.Temperature = [24.3, -3.5];
12-
test.Humidity = [60.7, 54.2];
13-
test.RainDrops = int64([123456789, -987654321]);
14-
test.WindDirection = {'north', 'west'};
15-
test.Raining = [true, false];
11+
test.Temperature = [24.3; -3.5];
12+
test.Humidity = [60.7; 54.2];
13+
test.RainDrops = int64([123456789; -987654321]);
14+
test.WindDirection = {'north'; 'west'};
15+
test.Raining = [true; false];
1616
end
1717
end
1818

@@ -184,8 +184,8 @@ function every_property_is_used(test)
184184
function skips_nonfinite_fields(test)
185185
s = Series('weather') ...
186186
.time(test.Time) ...
187-
.fields('temperature', [NaN, -3.5]) ...
188-
.fields('humidity', [60.7, Inf]);
187+
.fields('temperature', [NaN; -3.5]) ...
188+
.fields('humidity', [60.7; Inf]);
189189
exp = [ ...
190190
'weather humidity=60.7 1529933525520' newline ...
191191
'weather temperature=-3.5 1529933581618'];
@@ -195,8 +195,8 @@ function skips_nonfinite_fields(test)
195195
function skips_nonfinite_samples(test)
196196
s = Series('weather') ...
197197
.time(test.Time) ...
198-
.fields('temperature', [24.3, Inf]) ...
199-
.fields('humidity', [-Inf, NaN]);
198+
.fields('temperature', [24.3; Inf]) ...
199+
.fields('humidity', [-Inf; NaN]);
200200
exp = 'weather temperature=24.3 1529933525520';
201201
test.verifyEqual(s.toLine(), exp);
202202
end

0 commit comments

Comments
 (0)