LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > astrogeek
User Name
Password

Notices


Old

Test Cases: Sign

Posted 10-11-2021 at 12:54 AM by astrogeek

This post is part of the Alphanumeric Calculator program group.

Test cases to validate handling of sign.

The test case input file:

Code:
cat tests_sign
#both
############ Numbers with signs
+0
+1
-0
-1
-1*-1
-1*+1
+1*-1
+1*+1
############ Numeric expressions with signs
positive zero
positive one
negative zero
negative one
negative one times
...
Moderator
Views 474 Comments 0 astrogeek is offline
Old

Test Cases: Limits

Posted 10-11-2021 at 12:53 AM by astrogeek

This post is part of the Alphanumeric Calculator program group.

Test cases to validate limits and range of expressions, undefined input errors.

Test cases input file:

Code:
cat tests_limits
/* Tests detection and reporting of limits and unexpected input
*/
######## Valid - Min/Max values
999999999999
-999999999999
nine hundred ninety nine billion nine hundred ninety nine million nine hundred ninety nine thousand nine
...
Moderator
Views 128 Comments 0 astrogeek is offline
Old

Test Cases: Associativity and Precedence of Math Expressions

Posted 10-11-2021 at 12:53 AM by astrogeek

This post is part of the Alphanumeric Calculator program group.

Test cases to validate associativity and precedence handling in math expressions.

Test cases input file:

Code:
cat tests_precedence
/* Test of associativity and precedence in math expressions
   Input here is symbolic for clarity, alpha input will test same, not shown
   Remember: This is integer math as performed by basic C oeprators on long long values
*/
numeric
...
Moderator
Views 106 Comments 0 astrogeek is offline
Old

Test Cases: Optional AND Input and Output Handling

Posted 10-11-2021 at 12:52 AM by astrogeek
Updated 10-11-2021 at 01:10 AM by astrogeek

This post is part of the Alphanumeric Calculator program group.

Test cases to validate handling of optional "and" in english numeric expressions.

Use of "and" in input stream is always optional. For example, either of these basic forms is allowed:

Code:
one thousand one hundred one
one thousand one hundred and one
By default output follows input usage per expression - if "and" appears in the...
Moderator
Views 54 Comments 0 astrogeek is offline
Old

Test Cases: Multi-line Input

Posted 10-11-2021 at 12:52 AM by astrogeek

This post is part of the Alphanumeric Calculator program group.

Test cases to validate multi-line input expressions.

By design a single expression is terminated by a line break. But you may enter expressions which span multiple lines by escaping the line break with a backslash as the last character before the line break similar to the usage in C preprocessor macro definitions, among others.

Test cases input file:

Code:
cat tests_multiline
...
Moderator
Views 83 Comments 0 astrogeek is offline

  



All times are GMT -5. The time now is 05:37 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration