capitalize.c

v22.2b14/testsuite/single/tests/efuns/capitalize.c · 640 B

From the archive beta.tar.gz

Download the archive   « Back to the archive contents

/*
          efun: string capitalize(string);
   test author: John Garnett
          date: 1993 November 2
*/

void do_tests()
{
    string str1, str2, str3;

    str1 = "";
    str2 = capitalize(str1);
    str3 = "";
    ASSERT(str2 == str3);

    str1 = "driver";
    str2 = capitalize(str1);
    str3 = "Driver";
    ASSERT(str2 == str3);
    ASSERT(str1 == "driver");
    
    str1 = "Driver";
    str2 = capitalize(str1);
    str3 = "Driver";
    ASSERT(str2 == str3);
    ASSERT(str1 == "Driver");

    str1 = "42driver";
    str2 = capitalize(str1);
    str3 = "42driver";
    ASSERT(str2 == str3);
    ASSERT(str1 == "42driver");
}

Site Stats

Snippets: 1791
Codebases: 571