// testParseForbinIntC.cpp
#include "textUtility2.h" // includes <iostream>
void test(char text[]);
int main()
{
test("0");
test("-1");
test("9");
test("-9");
test("2147483647");
test("-2147483648");
test("000000000000000000002147483647");
test("-000000000000000000002147483648");
pause();
test("2147483648");
test("-2147483649");
test("-2147483650");
test("-2147500000");
test("123456789012345678901234567890");
pause();
test("-");
test("0-");
test("/");
test("-/");
test(":");
test("-:");
test("a2");
test("2a");
cout << endl << "Empty string:" << endl;
test(""); // empty String literal ""
} // function main
void test(char text[])
{
int number;
bool testTrue = parseForbinInt(text, number);
cout << "Your function ";
cout << "says \"" << text << "\" ";
cout << ( testTrue ? "DOES" : "does NOT" );
cout << " represent a forbin int";
if (testTrue)
cout << ", with value " << number;
cout << "." << endl;
} // function testIsInteger