LangProc / langproc-2017-lab

4 stars 8 forks source link

Error in ref files for hard test of lab 1 #52

Closed ps-george closed 6 years ago

ps-george commented 7 years ago

This is sed's output for test 5 of part b: image

The ref has this:

ds f 
as d sds a aas d 

To emulate sed, should be as above:

fds
as d sds a adas
divyanshmanocha commented 7 years ago

The log seems to say everyone (that I know of) failed this test.

m8pple commented 7 years ago

Well, some people (not many) passed this component of the test. Maybe they would like to comment?

Just in case you're wondering, I do look at all the individual outputs for the hard tests, so if I see lots of people failing a particular test, I will have investigated and: 1 - decided that it is correct 2 - decided there is enough context for people to work out why it was failing

Not that I claim to be perfect or have perfect systems, so feel free to question odd results that may have snuck through, but in this instance I'm very much aware of it as a common failure.

ps-george commented 7 years ago

I thought the error came from reading in the input line by line, because running the individual lines through sed give the output I posted above. But having changed that, the regex_replace with format_sed flag still has a different output to sed.

Why is this? According to the C++ reference , it should Use the same rules as the sed utility in POSIX to replace matches.

m8pple commented 7 years ago

Nobody who got this test-case correct is biting, so I'll highlight this from the spec:

Your program should have the same behaviour as the script regex_substitute_ref.sh, which you can use for testing. If you look inside the script, you can see it simply invokes sed.

I'll also highlight this, which is the set of options that can be passed to std::regex::regex:

http://en.cppreference.com/w/cpp/regex/syntax_option_type

(There is deliberately only one test-case that hits this behaviour).