From 21b828eda7ffc578125c81c1507fab6c1b0e7589 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Sun, 4 Aug 2019 01:16:08 +0900 Subject: [PATCH] line breaks in c++ code (cont) --- test_build_markdown_cpp_cell.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/test_build_markdown_cpp_cell.py b/test_build_markdown_cpp_cell.py index 5209d7fd..88ad5cd7 100644 --- a/test_build_markdown_cpp_cell.py +++ b/test_build_markdown_cpp_cell.py @@ -101,7 +101,37 @@ '```' )}, {'result': 0, 'cpp_filename': 'account_module.h'}], -[{'cell_type': 'markdown', 'metadata': {}, 'source': '``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n```\n\n'}, +[{'cell_type': 'markdown', 'metadata': {}, 'source': ( + '``` C++\n' + '// Begin account_module.cpp\n' + '#include \n' + '#include \n' + '\n' + '#include "account_module.h"\n' + '\n' + 'using namespace std;\n' + '\n' + 'namespace account{\n' + ' int32_t balance;\n' + '\n' + ' void deposit (int32_t amount){\n' + ' cout << "Deposit " << amount << \'\\n\';\n' + ' balance += amount;\n' + ' }\n' + '\n' + ' void withdraw (int32_t amount){\n' + ' cout << "Depowithdrawsit " << amount << \'\\n\';\n' + ' balance += -amount;\n' + ' }\n' + '\n' + ' int32_t check(){\n' + ' return balance;\n' + ' }\n' + '}\n' + '// End account_module.cpp\n' + '```\n' + '\n' + )}, {'result': 0, 'cpp_filename': 'account_module.cpp'}], [{'cell_type': 'markdown', 'metadata': {}, 'source': '\n``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n```\n\n'}, {'result': 0, 'cpp_filename': 'account_module_user.cpp'}],