-
Notifications
You must be signed in to change notification settings - Fork 162
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
Test Error improvements #2531
Conversation
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] = "") |
There was a problem hiding this comment.
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] = '#'
There was a problem hiding this comment.
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)
05a484d
to
0762956
Compare
Codecov Report
@@ 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
|
0762956
to
8c6ea35
Compare
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
8c6ea35
to
7dd3723
Compare
7dd3723
to
13c7dd4
Compare
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.