Revert D34455360: Multisect successfully blamed D34455360 for test failures

Summary:
This diff is reverting D34455360 (https://github.com/pytorch/pytorch/commit/61d6c4386459441710fb4cfa2929a3f77e95e5f7)
D34455360 (https://github.com/pytorch/pytorch/commit/61d6c4386459441710fb4cfa2929a3f77e95e5f7) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff

Tests affected:
- https://www.internalfb.com/intern/test/562950004334605/

Multisect link:
https://www.internalfb.com/intern/testinfra/multisect/756170

Test Plan: NA

Reviewed By: zhxchen17

Differential Revision: D34596156

fbshipit-source-id: a465bca0094db3caf6130c80f1ed49eea981359b
(cherry picked from commit ef5e5578c6)
This commit is contained in:
Han Qi
2022-03-08 15:12:32 -08:00
committed by PyTorch MergeBot
parent 2e039b653e
commit 0723639b60
25 changed files with 204 additions and 690 deletions
-32
View File
@@ -1,32 +0,0 @@
#include <gtest/gtest.h>
#include <torch/csrc/jit/frontend/source_range.h>
using namespace ::testing;
using namespace ::torch::jit;
TEST(SourceRangeTest, test_find) {
std::vector<std::shared_ptr<std::string>> strings;
strings.push_back(std::make_shared<std::string>("hello world"));
strings.push_back(std::make_shared<std::string>("nihaoma"));
std::vector<c10::string_view> pieces{*strings[0], *strings[1]};
StringCordView view(pieces, strings);
auto x = view.find("rldni", 0);
EXPECT_EQ(x, 8);
}
TEST(SourceRangeTest, test_substr) {
std::vector<std::shared_ptr<std::string>> strings;
strings.push_back(std::make_shared<std::string>("hello world"));
strings.push_back(std::make_shared<std::string>("nihaoma"));
std::vector<c10::string_view> pieces{*strings[0], *strings[1]};
StringCordView view(pieces, strings);
auto x = view.substr(4, 10).str();
EXPECT_EQ(x, view.str().substr(4, 10));
EXPECT_EQ(view.substr(0, view.size()).str(), view.str());
}