Lines Matching refs:Input
105 llvm::Optional<std::string> rewrite(StringRef Input) { in rewrite() argument
106 std::string Code = ("#include \"header.h\"\n" + Input).str(); in rewrite()
159 void testRule(RewriteRule Rule, StringRef Input, StringRef Expected) { in testRule() argument
163 compareSnippets(Expected, rewrite(Input)); in testRule()
166 void testRule(RewriteRuleWith<std::string> Rule, StringRef Input, in testRule() argument
171 compareSnippets(Expected, rewrite(Input)); in testRule()
174 void testRuleFailure(RewriteRule Rule, StringRef Input) { in testRuleFailure() argument
178 ASSERT_FALSE(rewrite(Input)) << "Expected failure to rewrite code"; in testRuleFailure()
181 void testRuleFailure(RewriteRuleWith<std::string> Rule, StringRef Input) { in testRuleFailure() argument
185 ASSERT_FALSE(rewrite(Input)) << "Expected failure to rewrite code"; in testRuleFailure()
220 std::string Input = "int f(string s) { return strlen(s.c_str()); }"; in TEST_F() local
222 testRule(ruleStrlenSize(), Input, Expected); in TEST_F()
227 std::string Input = "int f(string s) { return s.size(); }"; in TEST_F() local
228 testRule(ruleStrlenSize(), Input, Input); in TEST_F()
241 std::string Input = R"cc( in TEST_F() local
252 testRule(std::move(Rule), Input, Expected); in TEST_F()
260 std::string Input = R"cc( in TEST_F() local
270 testRule(Rule, Input, Expected); in TEST_F()
279 std::string Input = R"cc( in TEST_F() local
289 testRule(Rule, Input, Expected); in TEST_F()
297 std::string Input = R"cc( in TEST_F() local
307 testRule(Rule, Input, Expected); in TEST_F()
315 std::string Input = R"cc( in TEST_F() local
325 testRule(Rule, Input, Expected); in TEST_F()
333 std::string Input = R"cc( in TEST_F() local
342 testRule(Rule, Input, Expected); in TEST_F()
346 std::string Input = R"cc( in TEST_F() local
364 Input, Expected); in TEST_F()
368 std::string Input = R"cc( in TEST_F() local
384 EXPECT_FALSE(rewrite(Input)); in TEST_F()
393 std::string Input = R"cc( in TEST_F() local
412 testRule(Rule, Input, Expected); in TEST_F()
416 std::string Input = R"cc( in TEST_F() local
446 Input, Expected); in TEST_F()
450 std::string Input = R"cc( in TEST_F() local
478 Input, Expected); in TEST_F()
483 std::string Input = "int f(int x) { return x; }"; in TEST_F() local
484 testRule(makeRule(returnStmt().bind("return"), noEdits()), Input, Input); in TEST_F()
490 std::string Input = "int f(int x) { return x; }"; in TEST_F() local
492 Input, Input); in TEST_F()
497 std::string Input = "int f(int x) { return x; }"; in TEST_F() local
501 Input, Expected); in TEST_F()
506 std::string Input = "int f(int x) { return x; }"; in TEST_F() local
511 Input, Expected); in TEST_F()
516 std::string Input = "int f(int x) { return x; }"; in TEST_F() local
521 Input, Expected); in TEST_F()
526 std::string Input = in TEST_F() local
534 Input, Expected); in TEST_F()
539 std::string Input = "int f(int *x) { return *x; }"; in TEST_F() local
545 Input, Expected); in TEST_F()
552 std::string Input = in TEST_F() local
560 Input, Expected); in TEST_F()
564 std::string Input = in TEST_F() local
575 Input, Expected); in TEST_F()
579 std::string Input = "int f(int *x) { return *x; }"; in TEST_F() local
589 Input, Expected); in TEST_F()
593 std::string Input = in TEST_F() local
604 Input, Expected); in TEST_F()
608 std::string Input = in TEST_F() local
616 EXPECT_FALSE(rewrite(Input)); in TEST_F()
622 std::string Input = in TEST_F() local
633 EXPECT_FALSE(rewrite(Input)); in TEST_F()
647 std::string Input = in TEST_F() local
660 Input, Expected); in TEST_F()
664 std::string Input = in TEST_F() local
677 Input, Expected); in TEST_F()
681 std::string Input = "int f(int *x) { return *x; }"; in TEST_F() local
696 Input, Expected); in TEST_F()
703 std::string Input = in TEST_F() local
717 Input, Expected); in TEST_F()
721 std::string Input = R"cc( in TEST_F() local
737 Input, Expected); in TEST_F()
741 std::string Input = R"cc( in TEST_F() local
759 Input, Expected); in TEST_F()
763 std::string Input = R"cc( in TEST_F() local
778 Input, Expected); in TEST_F()
788 std::string Input = R"cc( in TEST_F() local
805 Factory->create(), Input, std::vector<std::string>(), "input.cc", in TEST_F()
814 std::string Input = R"cc( in TEST_F() local
836 Input, Expected); in TEST_F()
840 std::string Input = R"cc( in TEST_F() local
863 Input, Expected); in TEST_F()
867 std::string Input = R"cc( in TEST_F() local
890 Input, Expected); in TEST_F()
895 std::string Input = R"cc( in TEST_F() local
918 Input, Expected); in TEST_F()
930 std::string Input = R"cc( in TEST_F() local
943 testRule(applyFirst({ruleStrlenSize(), FlagRule}), Input, Expected); in TEST_F()
947 std::string Input = R"cc( in TEST_F() local
966 testRule(applyFirst({ReplaceF1, ReplaceF1OrF2}), Input, Expected); in TEST_F()
972 std::string Input = R"cc( in TEST_F() local
991 testRule(applyFirst({ReplaceF1OrF2, ReplaceF1}), Input, Expected); in TEST_F()
1000 std::string Input = R"cc( in TEST_F() local
1024 testRule(Rule, Input, Expected); in TEST_F()
1030 std::string Input = R"cc( in TEST_F() local
1049 testRule(applyFirst({ReplaceF1, ReplaceF2}), Input, Expected); in TEST_F()
1058 std::string Input = "int conflictOneRule() { return 3 + 7; }"; in TEST_F() local
1073 EXPECT_FALSE(rewrite(Input)); in TEST_F()
1080 std::string Input = "int conflictOneRule() { return 3 + 7; }"; in TEST_F() local
1088 EXPECT_FALSE(rewrite(Input)); in TEST_F()
1095 std::string Input = "int conflictOneRule() { return -7; }"; in TEST_F() local
1103 EXPECT_FALSE(rewrite(Input)); in TEST_F()
1111 std::string Input = "void errorOccurred() { 3 }"; in TEST_F() local
1117 EXPECT_FALSE(rewrite(Input)); in TEST_F()
1432 std::string Input = R"cc( in TEST_F() local
1444 testRule(R, Input, Expected); in TEST_F()
1450 std::string Input = R"cc( in TEST_F() local
1459 testRule(ruleStrlenSize(), Input, Expected); in TEST_F()
1464 std::string Input = R"cc( in TEST_F() local
1473 testRule(ruleStrlenSize(), Input, Expected); in TEST_F()
1479 std::string Input = R"cc( in TEST_F() local
1490 testRule(ruleStrlenSize(), Input, Expected); in TEST_F()
1499 std::string Input = R"cc( in TEST_F() local
1508 testRule(ruleStrlenSize(), Input, Expected); in TEST_F()
1514 std::string Input = R"cc( in TEST_F() local
1523 testRule(makeRule(integerLiteral(), changeTo(cat("LIT"))), Input, Expected); in TEST_F()
1529 std::string Input = R"cc( in TEST_F() local
1541 Input, Expected); in TEST_F()
1547 std::string Input = R"cc( in TEST_F() local
1559 Input, Expected); in TEST_F()
1567 std::string Input = R"cc( in TEST_F() local
1574 testRule(R, Input, Input); in TEST_F()
1582 std::string Input = R"cc( in TEST_F() local
1588 testRule(ruleStrlenSize(), Input, Input); in TEST_F()
1715 std::string Input = R"cc(int target = 0;)cc"; in TEST_F() local
1719 testRule(std::move(Rule), Input, Expected); in TEST_F()
1725 std::string Input = R"cc(int target = 0;)cc"; in TEST_F() local
1728 testRule(std::move(Rule), Input, Input); in TEST_F()
1741 std::string Input = R"cc(int target = 0;)cc"; in TEST_F() local
1745 testRuleFailure(std::move(Rule), Input); in TEST_F()