"Fossies" - the Fresh Open Source Software Archive

Member "asymptote-2.60/tests/string/rfind.asy" (6 Nov 2019, 187 Bytes) of package /linux/misc/asymptote-2.60.src.tgz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 import TestLib;
    2 StartTest("rfind");
    3 string s = "abcdefab";
    4 assert(rfind(s,"cd") == 2);
    5 assert(rfind(s,"cd",1) == -1);
    6 assert(rfind(s,"ab") == 6);
    7 assert(rfind(s,"ab",5) == 0);
    8 EndTest();