Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <string>
- std::string getGreeting();
- #include "Greeting.h"
- std::string getGreeting() {
- return "Hello world!";
- }
- #pragma once
- void test();
- #include "Test.h"
- #include "Greeting.h"
- #include <cassert>
- #include <iostream>
- void test() {
- auto greeting = getGreeting();
- assert(greeting == "Hello world!");
- std::cout << "Test passes!n";
- }
- #include "Test.h"
- #include "Greeting.h"
- #include <iostream>
- void run() {
- std::cout << getGreeting() << "n";
- }
- int main(int argc, char *argv[]) {
- if (argc > 1 && strcmp(argv[1], "-t") == 0)
- test();
- else
- run();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement