Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Filename: test_input.cpp
- // Description: Tests string's input method
- //Author: Venix Cador
- // Date: 02/24/2013
- #include "string.h"
- #include <cassert>
- #include <fstream>
- int main()
- {
- std::ifstream in("input_test_data.txt");
- if(!in){
- std::cerr <<"could not open input_test_data.txt, existing!" <<std::endl;
- std::exit(1);
- }
- {
- String input;
- in >> input;
- std::cout << "'" << input << "'" <<std::endl;
- assert(input == " Almost there to get something to eat");
- }
- in.close();
- std::cout << "Completed tsting string's input function!" << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment