| 25 | }; |
| 26 | |
| 27 | TEST_F(WorkflowFixture, Util_sanitizeKey) { |
| 28 | |
| 29 | const std::map<std::string, std::string> hash_with_sanitized_keys = { |
| 30 | {"Regular", "Regular"}, |
| 31 | {"key1!@#", "key1"}, |
| 32 | {"key2.{}\\", "key2"}, |
| 33 | {"key3_ ", "key3"}, |
| 34 | {"invalid|key", "invalid_key"}, |
| 35 | {"another key", "another key"}, |
| 36 | {"special@char", "special_char"}, |
| 37 | {"key.with.dots", "key_with_dots"}, |
| 38 | {"key with spaces", "key with spaces"}, |
| 39 | {"slashes\\/included", "slashes_included"}, |
| 40 | {"pipe|character", "pipe_character"}, |
| 41 | {"!exclamation", "_exclamation"}, |
| 42 | {"@at_symbol", "_at_symbol"}, |
| 43 | {"#hash_symbol", "_hash_symbol"}, |
| 44 | {"$dollar_sign", "_dollar_sign"}, |
| 45 | {"%percent_sign", "_percent_sign"}, |
| 46 | {"^caret", "_caret"}, |
| 47 | {"&ersand", "_ampersand"}, |
| 48 | {"*asterisk", "_asterisk"}, |
| 49 | {"(open_parenthesis)", "_open_parenthesis"}, |
| 50 | {"{open_brace}", "_open_brace"}, |
| 51 | {"}close_brace{", "_close_brace"}, |
| 52 | {"\\backslash\\", "_backslash"}, |
| 53 | {"[open_square]", "_open_square"}, |
| 54 | {"]close_square", "_close_square"}, |
| 55 | {";semicolon;", "_semicolon"}, |
| 56 | {":colon:", "_colon"}, |
| 57 | {"'single_quote'", "_single_quote"}, |
| 58 | {"\"double_quote\"", "_double_quote"}, |
| 59 | {",comma,", "_comma"}, |
| 60 | {"<less_than>", "_less_than"}, |
| 61 | {".period.", "_period"}, |
| 62 | {">greater_than<", "_greater_than"}, |
| 63 | {"/forward_slash/", "_forward_slash"}, |
| 64 | {"?question_mark?", "_question_mark"}, |
| 65 | {"=equal_sign=", "_equal_sign"}, |
| 66 | {"+plus_sign+", "_plus_sign"}, |
| 67 | {"___", ""}, // Consecutive underscores to be squeezed |
| 68 | {"key_with___underscores", "key_with_underscores"}, |
| 69 | {"key_with__underscores", "key_with_underscores"}, |
| 70 | {"key_with_underscores", "key_with_underscores"}, |
| 71 | {"__underscored__key__", "_underscored_key"}, // Multiple underscores within the key |
| 72 | {"___double___underscores___", "_double_underscores"} // Multiple consecutive underscores |
| 73 | }; |
| 74 | |
| 75 | for (const auto& [originalKey, expectedKey] : hash_with_sanitized_keys) { |
| 76 | const std::string sanitizedKey = openstudio::workflow::util::sanitizeKey(originalKey); |
| 77 | // Check if the sanitized key matches the expected value |
| 78 | EXPECT_EQ(sanitizedKey, expectedKey) << "Error: Key '" << originalKey << "' was not sanitized as expected."; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | TEST_F(WorkflowFixture, Util_mergeOutputTableSummaryReports) { |
| 83 | IdfObject existingObject(IddObjectType::Output_Table_SummaryReports); |
nothing calls this directly
no test coverage detected