| 896 | } |
| 897 | |
| 898 | void isOp() const { |
| 899 | std::vector<std::string> test_ops; |
| 900 | append_vector(test_ops, arithmeticalOps); |
| 901 | append_vector(test_ops, bitOps); |
| 902 | append_vector(test_ops, comparisonOps); |
| 903 | append_vector(test_ops, logicalOps); |
| 904 | append_vector(test_ops, assignmentOps); |
| 905 | |
| 906 | for (auto test_op = test_ops.cbegin(); test_op != test_ops.cend(); ++test_op) { |
| 907 | auto tokensFrontBack = std::make_shared<TokensFrontBack>(); |
| 908 | Token tok(list, std::move(tokensFrontBack)); |
| 909 | tok.str(*test_op); |
| 910 | ASSERT_EQUALS(true, tok.isOp()); |
| 911 | } |
| 912 | |
| 913 | // Negative test against other operators |
| 914 | std::vector<std::string> other_ops; |
| 915 | append_vector(other_ops, extendedOps); |
| 916 | |
| 917 | for (auto other_op = other_ops.cbegin(); other_op != other_ops.cend(); ++other_op) { |
| 918 | auto tokensFrontBack = std::make_shared<TokensFrontBack>(); |
| 919 | Token tok(list, std::move(tokensFrontBack)); |
| 920 | tok.str(*other_op); |
| 921 | ASSERT_EQUALS_MSG(false, tok.isOp(), "Failing normal operator: " + *other_op); |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | void isConstOp() const { |
| 926 | std::vector<std::string> test_ops; |
no test coverage detected