Skip to content

Commit d468a2a

Browse files
committed
update mh config for test folders to allow more readable test function names
1 parent cab0a9e commit d468a2a

File tree

8 files changed

+22
-11
lines changed

8 files changed

+22
-11
lines changed

tests/miss_hit.cfg

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# style guide (https://florianschanda.github.io/miss_hit/style_checker.html)
22
line_length: 100
3-
regex_function_name: "((test_[a-z]+)|[a-z]+)(([A-Z]){1}[A-Za-z]+)*"
4-
regex_parameter_name: "test_suite|[a-z]+(([A-Z]){1}[A-Za-z]+)*"
5-
suppress_rule: "copyright_notice"
3+
4+
# camelCase for helper functions
5+
# test_nameOfTheTestedFunction_comment_for_each_test
6+
regex_function_name: "[a-z]+([A-Z]{1}[a-z]+)*|test_([a-z]+([A-Z0-9]*[a-z0_9]*)+)(_[a-z0_9]*)*"
7+
8+
# all uppercase or camelCase
9+
regex_parameter_name: "test_suite|[A-Z]*|[a-z]+([A-Z]{1}[a-z]+)*"
610

711
# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)
8-
metric "cnest": limit 4
12+
metric "cnest": limit 3
913
metric "file_length": limit 500
10-
metric "cyc": limit 15
11-
metric "parameters": limit 5
14+
metric "cyc": limit 10
15+
metric "parameters": limit 3

tests/test_expDesign.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_expDesign %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine

tests/test_getDesignInput.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_getDesignInput %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine

tests/test_getDirectionBaseVectors.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_getDirectionBaseVectors %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine

tests/test_setBlocksConditions.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_setBlocksConditions %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine
@@ -17,8 +18,8 @@ function test_getDirectionBaseVectors_MT()
1718
nbRepeats = cfg.design.nbRepetitions;
1819

1920
assertEqual(conditionNamesVector, repmat(conditions, nbRepeats, 1));
20-
assertEqual(idxCondition1, (1:2:numel(conditions)*nbRepeats)');
21-
assertEqual(idxCondition2, (2:2:numel(conditions)*nbRepeats)');
21+
assertEqual(idxCondition1, (1:2:numel(conditions) * nbRepeats)');
22+
assertEqual(idxCondition2, (2:2:numel(conditions) * nbRepeats)');
2223

2324
end
2425

@@ -33,7 +34,7 @@ function test_getDirectionBaseVectors_MST()
3334
nbRepeats = cfg.design.nbRepetitions;
3435

3536
assertEqual(conditionNamesVector, repmat(conditions, nbRepeats, 1));
36-
assertEqual(idxCondition1, (1:2:numel(conditions)*nbRepeats)');
37-
assertEqual(idxCondition2, (2:2:numel(conditions)*nbRepeats)');
37+
assertEqual(idxCondition1, (1:2:numel(conditions) * nbRepeats)');
38+
assertEqual(idxCondition2, (2:2:numel(conditions) * nbRepeats)');
3839

3940
end

tests/test_setDirections.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_setDirections %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine
@@ -20,7 +21,7 @@ function test_setDirections_MT()
2021

2122
% static every second block
2223
assertEqual(directions(1:2:end, :), ones(cfg.design.nbRepetitions, ...
23-
cfg.design.nbEventsPerBlock) * -1);
24+
cfg.design.nbEventsPerBlock) * -1);
2425

2526
end
2627

tests/test_setFixationTargets.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_setFixationTargets %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine

tests/test_setSpeedTargets.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function test_suite = test_setSpeedTargets %#ok<*STOUT>
2+
% (C) Copyright 2021 CPP visual motion localizer developpers
23
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
34
test_functions = localfunctions(); %#ok<*NASGU>
45
catch % no problem; early Matlab versions can use initTestSuite fine

0 commit comments

Comments
 (0)