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

Expand unit testing for more cases #1

Merged

Conversation

awvwgk
Copy link

@awvwgk awvwgk commented Jun 26, 2021

@zoziha @St-Maxwell Here is suggestion for expanding the test suite for the format_string PR.

 format_string(complex) : 
 - Default formatter for complex number
   Result: '(1.00000000,1.00000000)'
 - Formatter for complex number
   Result: '(  1.00,  1.00)'
 - Formatter for negative complex number
   Result: '( -1.00, -1.00)'
 - Formatter with sign control descriptor for complex number
   Result: '( +1.00, +1.00)'
 - Multiple formatters for complex numbers
   Result: '(  1.00,  1.00)(  2.000,  2.000)'
 format_string(integer) : 
 - Default formatter for integer number
   Result: '100'
 - Formatter for integer number
   Result: '   100'
 - Formatter with zero padding for integer number
   Result: '000100'
 - Multiple formatters for integers
   Result: '   100   1000'
 - Binary formatter for integer number
   Result: '  100010'
 - Octal formatter with zero padding for integer number
   Result: '042'
 - Hexadecimal formatter for integer number
   Result: ' 22'
 format_string(real) : 
 - Default formatter for real number
   Result: '100.000000'
 - Formatter for real number
   Result: '100.00'
 - Exponential formatter with rounding for real number
   Result: '.29E+03'
 - Exponential formatter for real number
   Result: '1.28E+02'
 - Too narrow formatter for signed real number
   Result: '******'
 - Too narrow formatter for real number
   Result: '******'
 - Real formatter for integer number
   Result: '*'
 format_string(logical) : 
 - Default formatter for logcal value
   Result: 'T'
 - Formatter for logical value
   Result: ' T'
 - Multiple formatters for logical values
   Result: ' F    T'
 - Integer formatter for logical value
   Result: '*'

call check_formatter(format_string(34, '(O0.3)'), "042", &
& "Octal formatter with zero padding for integer number")
call check_formatter(format_string(34, '(Z3)'), " 22", &
& "Hexadecimal formatter for integer number")
Copy link
Owner

Choose a reason for hiding this comment

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

👍Good idea. The test cases for binary, octal and hexadecimal format are inspiring.

@St-Maxwell St-Maxwell merged commit 7f6c3c6 into St-Maxwell:zoziha/feature/format_string Jun 26, 2021
St-Maxwell pushed a commit that referenced this pull request Nov 22, 2022
Minor adjustments to deployment script
St-Maxwell pushed a commit that referenced this pull request Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants