HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 0644 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 0644.


Report 0644 Actions


    Problem Report Number 0644
    Submitter's Classification Test Suite problem
    State Resolved
    Resolution Rejected (REJ)
    Problem Resolution ID REJ.X.0248
    Raised 1970-01-01 08:00
    Updated 2003-03-13 08:00
    Published null
    Product Standard Commands and Utilities V2 (UNIX 95)
    Certification Program The Open Brand certification program
    Test Suite VSC version 4.1.4
    Test Identification /tset/POSIX.cmd/grep/grep 65
    Problem Summary PG4C.00028 Test should report lines multiple times, once for each pattern it matches.
    Problem Text
    There seem to be many problems with this test.

    For the 1st sub-test.

    grep -i "$pattern_list_065_3" grep065.inp > $CT_STDOUT 2> $CT_STDERR

    1.) The "expected" file pattern "grep065.exp" is wrong as the
    order of the 2nd line and 3rd line are reversed.

    grep -i "$pattern_list_065_3" grep065.inp

    should produce

    aAa111
    cCc333
    bBb222

    not the expected output

    aAa111
    bBb222
    cCc333

    from the input file

    aAa111
    xxxx
    bBb222
    yyyy
    cCc333

    since pattern_list_065_3=`printf "%s\n%s\n%s" aa cc bb` specifies
    that "cc" is grep-ed before "bb".

    According to the manual page, the order of evaluation can be
    unspecified, so the "expected result" should take
    this into account.

    2.) Even the "cmp" fails but the test suite still reports it
    PASSes as it looks for the error message in Standard Error, which
    is none in this case.

    For this test, the manual page states that the "order of
    evaluation is not specified", hence, the test suite should be
    able to match the output with the correct content rather than
    exact match.



    For the 2nd test:

    grep -i -e "$pattern_list_065_1" -e "$pattern_list_065_2" grep065.inp

    3.) The expected pattern file is incorrect. The output should
    have the lines matched to "aa" twice as they are grep-ed twice.
    The correct output should be:

    aAa111
    bBb222
    aAa111
    cCc333

    where:

    pattern_list_065_1=`printf "%s\n%s" aa bb`
    pattern_list_065_2=`printf "%s\n%s" aa cc`

    4.) Again, the test suite checks on the standard error, and
    reports the test PASS.



    For the 3rd test:

    grep -i -f grep065.pf1 -f grep065.pf2 grep065.inp

    5.) The expected pattern file is incorrect. The output should
    have the lines matched to "aa" twice as they are grep-ed twice.
    The correct output should be:

    aAa111
    bBb222
    aAa111
    cCc333

    where grep065.pf1 has the following content:

    aa
    bb

    and grep065.pf2 has the following expressions:

    aa
    cc

    6.) Again, the test suite checks on the standard error, and
    reports the test PASS.
    Test Output
    10|1 /tset/POSIX.cmd/grep/grep.ex 10:12:29|TC Start, scenario ref 730-1, ICs {65}
    15|1 1.10 1|TCM Start
    400|1 65 1 10:12:40|IC Start
    200|1 1 10:12:40|TP Start
    520|1 1 2960 1 1|Assertion #65 (A): Test -i pattern-list.
    520|1 1 2960 1 1|Standard output isn't the same as file 'grep065.exp'
    520|1 1 2960 1 2|diff of "out.stdout" and "grep065.exp":
    520|1 1 2960 1 3|*** out.stdout Mon Aug 14 10:12:41 1995
    520|1 1 2960 1 4|--- grep065.exp Mon Aug 14 10:12:30 1995
    520|1 1 2960 1 5|***************
    520|1 1 2960 1 6|*** 1,3 ****
    520|1 1 2960 1 7| aAa111
    520|1 1 2960 1 8|- cCc333
    520|1 1 2960 1 9| bBb222
    520|1 1 2960 1 10|--- 1,3 ----
    520|1 1 2960 1 11| aAa111
    520|1 1 2960 1 12| bBb222
    520|1 1 2960 1 13|+ cCc333
    520|1 1 2960 1 14|Standard output isn't the same as file 'grep065.exp'
    520|1 1 2960 1 15|diff of "out.stdout" and "grep065.exp":
    520|1 1 2960 1 16|*** out.stdout Mon Aug 14 10:12:44 1995
    520|1 1 2960 1 17|--- grep065.exp Mon Aug 14 10:12:30 1995
    520|1 1 2960 1 18|***************
    520|1 1 2960 1 19|*** 1,4 ****
    520|1 1 2960 1 20| aAa111
    520|1 1 2960 1 21| bBb222
    520|1 1 2960 1 22|- aAa111
    520|1 1 2960 1 23| cCc333
    520|1 1 2960 1 24|--- 1,3 ----
    520|1 1 2960 1 25|Standard output isn't the same as file 'grep065.exp'
    520|1 1 2960 1 26|diff of "out.stdout" and "grep065.exp":
    520|1 1 2960 1 27|*** out.stdout Mon Aug 14 10:12:47 1995
    520|1 1 2960 1 28|--- grep065.exp Mon Aug 14 10:12:30 1995
    520|1 1 2960 1 29|***************
    520|1 1 2960 1 30|*** 1,4 ****
    520|1 1 2960 1 30|*** 1,4 ****
    520|1 1 2960 1 31| aAa111
    520|1 1 2960 1 32| bBb222
    520|1 1 2960 1 33|- aAa111
    520|1 1 2960 1 34| cCc333
    520|1 1 2960 1 35|--- 1,3 ----
    220|1 1 1 10:12:50|FAIL
    410|1 65 1 10:12:50|IC End
    80|1 0 10:12:54|TC End

    Review Information

    Review Type TSMA Review
    Start Date null
    Completed null
    Status Complete
    Review Recommendation No Resolution Given
    Review Response
    We recommend this request be refused.

    We have no idea what the references to reporting the test PASSes
    are talking about. The output properly marks the test as FAILing.

    As to the comments about the order and quantity of lines matched...

    It seems to us the submitter thinks the grep commands being
    executed should take a pattern specified, grep the specified file
    for that pattern, report any matches, then go to the next
    pattern, grep the specified file again and report any matches for
    that pattern, continuing until the list of patterns is exhausted.

    We believe the grep commands should read the first line, check to
    see if it contains a match with any patterns specified, print the
    line once if one or more matches exist, then continue with the
    next line until all lines have been tested.

    The spec implies this throughout the grep spec as it consistently
    talks about matching a line to any of the patterns.

    The paragraph above

    According to the manual page, the order of evaluation can be
    unspecified, so the "expected result" should take this into
    account.

    is taking the spec out of context. This is based on the spec statement

    All of the specified patterns are used when matching lines, but
    the order of evaluation is unspecified.

    The POSIX grep rationale states that this was added to allow
    optimized matching if a null string appears in the list of patterns.
    It states

    If an implementation finds a null string as a pattern it is
    allowed to use that pattern first (matching every line) and
    effectively ignore every other pattern.

    Please note that this rationale specifically disagrees with the
    submitter's idea of a single line being output once for each
    pattern it matches in the list.

    Review Type SA Review
    Start Date null
    Completed null
    Status Complete
    Review Resolution Rejected (REJ)
    Review Conclusion
    This request is refused.

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority