-
Notifications
You must be signed in to change notification settings - Fork 167
change parse_args_test to be more automated. #1023
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
Conversation
renamed the original test to interactive_parse_args_test. it read standard input and prints out the values it gets. there is still a parse_args_test.in text file that can be used as input, or typing from the termina. the new parse_args_test uses the fortran-testanything module which prints 'ok' for each test that passes. this version of the test needs no input files.
|
i went back and forth on that, but sure. it was useful during development, but i guess at this point both it and the .in file can be removed. i'll do that. |
added tests for strings that look like floating point numbers, and strings with backslash and quoted strings.
hkershaw-brown
left a comment
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.
Thanks Nancy, much improved over the test in the repo.
I put a couple of changes for TAP (call plan(# tests) and initialize as standalone). I believe this test program can be run standalone, if not no big deal.
A couple of the test comments don't seem match the code, see comments on these.
Cheers,
Helen
| call ok((vals(3) == '3.0'), trim(testnum)//', val 3') | ||
| call ok((names(4) == ''), trim(testnum)//', name 4') | ||
| call ok((vals(4) == ''), trim(testnum)//', val 4') | ||
| call ok((.not. continue_line), trim(testnum)//', continue_line') |
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.
You don't have a check for continue_line = .true. ( & ).
Maybe add & to this test
nextline = 'a = 1.0 b = 2.0 c=3.0 &'
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.
good suggestion, fixed.
…h in code address helpful review comments in the test code and avoid the literal backslash in the module itself by using use ACHAR (like in the test program).
|
i think i've addressed all the helpful review comments. |
|
Note this pull request (will add edit in description) now also has ACHAR(92) in commit 16e3cd9 same commit as review comments) for backslash in parse_args_mod.f90 |
renamed the original test to interactive_parse_args_test. it read standard input and prints out the values it gets. there is still a parse_args_test.in text file that can be used as input, or typing from the terminal.
the new parse_args_test uses the fortran-testanything module which prints 'ok' for each test that passes. this version of the test needs no input files.
Description:
made the parse_args_test use the fortran-testanything routines and hardcoded the input inside the test so it can be more easily automated.
Edit Dec 29th 2025:
This pull request also changes parse_args_mod to have ACHAR(92) rather than
'\'Fixes issue
related to moha's #1009 pull request for the ARVOR obs converter. if this test is considered better than the original, then i'll make the csv read test use the same structure.
Types of changes
Documentation changes needed?
Tests
I ran the test program and it failed when I had bad values in the test cases and ran fine when I fixed them.
Checklist for merging
Checklist for release
Testing Datasets