4 ms·
I'm not a TDD (test driven development) zealot but this kind of problem is begging for a test harness. Even if you don't want to dive in and figure out the mem
by dugmartin 3y ago
I'm not a TDD (test driven development) zealot but this kind of problem is begging for a test harness. Even if you don't want to dive in and figure out the memcached test system you could write a script that did something like this to greatly speed up your development:
(echo "set age 0 3600 2"; echo "mult age 10"; echo "quit") | telnet 127.0.0.1 11211 | diff expected.txt -
and then create expected.txt to test the output. (Note: I created the command line from memory - maybe nc would be better to capture stdout.)
- viraptor 3y agoTelnet reads keypresses from terminal instead of using stdin/out. You need to use nc instead. Or expect, but that's stacking one terrible thing on top of another...