#include "io.hh"
int main()
{
cout << "**** BEGIN t-write-read2.exe\n";
string_buffer w;
w << "cat";
w << "(;; cat\n";
w << ";; ignore me!\n";
w << "*%^#$*^&@#$;;&^*^ foo bar\n";
w << "apple banana ";
w << "cat\"apple dog\";; comment!\n";
w << "banana \"foo bar\";; ignore me!\n";
w << "cat 'dog'smelly''';; comment\n";
{
File_Writer fw("t-write-read2.el");
fw << w;
}
String_Reader r(w);
r >> "cat";
r >> '(';
r >> "*%^#$*^&@#$";
r >> "apple";
r >> "banana";
r >> "cat";
string s1 = r.gulp_quoted_string();
ASSERT(s1.equals("apple dog"));
r >> "banana";
string s2 =r.gulp_quoted_string();
ASSERT(s2.equals("foo bar"));
r >> "cat";
r >> '\'';
r >> "dog";
r >> '\'';
r >> "smelly";
r >> '\'';
r >> '\'';
r >> '\'';
ASSERT(r.currently_eof());
cout << "**** All tests suceeded!\n";
cout << "**** END t-write-read2.exe\n";
return EXIT_SUCCESS;
}
END_OF_MAIN();