| 974 | } |
| 975 | |
| 976 | void isAssignmentOp() const { |
| 977 | for (auto test_op = assignmentOps.cbegin(); test_op != assignmentOps.cend(); ++test_op) { |
| 978 | auto tokensFrontBack = std::make_shared<TokensFrontBack>(); |
| 979 | Token tok(list, std::move(tokensFrontBack)); |
| 980 | tok.str(*test_op); |
| 981 | ASSERT_EQUALS(true, tok.isAssignmentOp()); |
| 982 | } |
| 983 | |
| 984 | // Negative test against other operators |
| 985 | std::vector<std::string> other_ops; |
| 986 | append_vector(other_ops, arithmeticalOps); |
| 987 | append_vector(other_ops, bitOps); |
| 988 | append_vector(other_ops, comparisonOps); |
| 989 | append_vector(other_ops, logicalOps); |
| 990 | append_vector(other_ops, extendedOps); |
| 991 | |
| 992 | for (auto other_op = other_ops.cbegin(); other_op != other_ops.cend(); ++other_op) { |
| 993 | auto tokensFrontBack = std::make_shared<TokensFrontBack>(); |
| 994 | Token tok(list, std::move(tokensFrontBack)); |
| 995 | tok.str(*other_op); |
| 996 | ASSERT_EQUALS_MSG(false, tok.isAssignmentOp(), "Failing assignment operator: " + *other_op); |
| 997 | } |
| 998 | } |
| 999 | |
| 1000 | void operators() const { |
| 1001 | for (auto test_op = extendedOps.cbegin(); test_op != extendedOps.cend(); ++test_op) { |
no test coverage detected