Skip to content

Commit

Permalink
line breaks in c++ code (cont)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangwonlee committed Aug 3, 2019
1 parent 1dbfe99 commit e113f99
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test_build_markdown_cpp_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,35 @@
'```\n'
'\n')},
{'result': 0, 'cpp_filename': 'account_module_user.cpp'}],
[{'cell_type': 'markdown', 'metadata': {}, 'source': '``` C++\n// Begin account_module.h\n#include <cstdint>\n#include <iostream>\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n std::cout << "to " << & balance << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Withdraws " << amount << \'\\n\';\n std::cout << "from " << & balance << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n```'},
[{'cell_type': 'markdown', 'metadata': {}, 'source': (
'``` C++\n'
'// Begin account_module.h\n'
'#include <cstdint>\n'
'#include <iostream>\n'
'\n'
'int32_t balance;\n'
'\n'
'\n'
'void deposit (int32_t amount){\n'
' std::cout << "Deposit " << amount << \'\\n\';\n'
' std::cout << "to " << & balance << \'\\n\';\n'
' balance += amount;\n'
'}\n'
'\n'
'\n'
'void withdraw (int32_t amount){\n'
' std::cout << "Withdraws " << amount << \'\\n\';\n'
' std::cout << "from " << & balance << \'\\n\';\n'
' balance += -amount;\n'
'}\n'
'\n'
'\n'
'int32_t check(){\n'
' return balance;\n'
'}\n'
'// End account_module.h\n'
'\n'
'```')},
{'result': 0, 'cpp_filename': 'account_module.h'}],
[{'cell_type': 'markdown', 'metadata': {}, 'source': '```C++\n// Begin account_module_user.cpp\n#include <iostream>\n#include <cstdint>\n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_b::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n```'},
{'result': 0, 'cpp_filename': 'account_module_user.cpp'}],
Expand Down

0 comments on commit e113f99

Please sign in to comment.