Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Error improvements #2531

Merged
merged 2 commits into from
Jun 12, 2018
Merged

Conversation

ChrisJefferson
Copy link
Contributor

@ChrisJefferson ChrisJefferson commented Jun 8, 2018

This makes two changes to #2519 .

Firstly, we produce a better error message, so we know where the problem is.

Secondly, add to the definition of Test files the option of having blank lines at the start of tests. This wasn't technically legal before, but it was used in various tests (including the Ferret package) and was silently accepted.

@olexandr-konovalov olexandr-konovalov added the topic: tests issues or PRs related to tests label Jun 8, 2018
lib/test.gi Outdated
lines[i][1] = '#' do
# ignore comment lines and empty lines at beginning of file
while i <= Length(lines) and
((Length(lines[i]) > 0 and lines[i][1] = '#') or lines[i] = "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler expresdion: Length(lines[i]) = 0 or lines[i][1] = '#'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (also the failing test)

@codecov
Copy link

codecov bot commented Jun 8, 2018

Codecov Report

Merging #2531 into master will increase coverage by 0.6%.
The diff coverage is 80%.

@@            Coverage Diff            @@
##           master    #2531     +/-   ##
=========================================
+ Coverage    74.4%      75%   +0.6%     
=========================================
  Files         481      481             
  Lines      243488   252048   +8560     
=========================================
+ Hits       181157   189047   +7890     
- Misses      62331    63001    +670
Impacted Files Coverage Δ
lib/test.gi 62.55% <80%> (+0.14%) ⬆️
src/exprs.c 90.39% <0%> (-3.58%) ⬇️
src/tietze.c 90.33% <0%> (-2.7%) ⬇️
src/calls.c 92.13% <0%> (-2.55%) ⬇️
src/permutat.c 84.11% <0%> (-2.4%) ⬇️
src/compiler.c 85.68% <0%> (-1.57%) ⬇️
src/code.c 92.36% <0%> (-1.37%) ⬇️
src/dteval.c 83.14% <0%> (-0.9%) ⬇️
src/vecgf2.c 71.6% <0%> (-0.46%) ⬇️
src/plist.c 93.61% <0%> (-0.31%) ⬇️
... and 21 more

@olexandr-konovalov olexandr-konovalov added the gapdays2018-spring Issues and PRs that arose at http://www.gapdays.de/gap-jupyter-days2018 label Jun 8, 2018
lib/test.gi Outdated
@@ -20,19 +20,18 @@ InstallGlobalFunction(ParseTestInput, function(str, ignorecomments)
ign := [];
i := 1;
while i <= Length(lines) do
if i = 1 and Length(lines[1]) > 0 and lines[1][1] = '#' then
if i = 1 and (lines[1] = "" or lines[1][1] = '#') then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this line creates a temporary empty string object each time it is executed, while the old version with Length does not create any temporaries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I'd assume function calls cost, but I agree that Length on strings is cheap. I don't really care about one string, but I have made the change so I can get this merged.

@fingolfin fingolfin merged commit 2288016 into gap-system:master Jun 12, 2018
@ChrisJefferson ChrisJefferson deleted the test-warning-2 branch July 9, 2018 14:22
@fingolfin fingolfin added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gapdays2018-spring Issues and PRs that arose at http://www.gapdays.de/gap-jupyter-days2018 release notes: added PRs introducing changes that have since been mentioned in the release notes topic: tests issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants