@@ -14,86 +14,87 @@ class AccessKeysTest : public ::testing::Test
1414protected:
1515
1616public:
17- void SetUp () override {
18- experimentalFeatureSettings.experimentalFeatures .get ().insert (Xp::Flakes);
17+ void SetUp () override
18+ {
19+ experimentalFeatureSettings.experimentalFeatures .get ().insert (Xp::Flakes);
1920 }
20- void TearDown () override { }
21+ void TearDown () override {}
2122};
2223
2324TEST_F (AccessKeysTest, singleOrgGitHub)
2425{
2526 fetchers::Settings fetchSettings = fetchers::Settings{};
26- fetchSettings.accessTokens .get ().insert ({" github.com/a" ," token" });
27+ fetchSettings.accessTokens .get ().insert ({" github.com/a" , " token" });
2728 auto i = Input::fromURL (fetchSettings, " github:a/b" );
2829
2930 auto token = i.scheme ->getAccessToken (fetchSettings, " github.com" , " github.com/a/b" );
30- ASSERT_EQ (token," token" );
31+ ASSERT_EQ (token, " token" );
3132}
3233
3334TEST_F (AccessKeysTest, nonMatches)
3435{
3536 fetchers::Settings fetchSettings = fetchers::Settings{};
36- fetchSettings.accessTokens .get ().insert ({" github.com" ," token" });
37+ fetchSettings.accessTokens .get ().insert ({" github.com" , " token" });
3738 auto i = Input::fromURL (fetchSettings, " gitlab:github.com/evil" );
3839
3940 auto token = i.scheme ->getAccessToken (fetchSettings, " gitlab.com" , " gitlab.com/github.com/evil" );
40- ASSERT_EQ (token,std::nullopt );
41+ ASSERT_EQ (token, std::nullopt );
4142}
4243
4344TEST_F (AccessKeysTest, noPartialMatches)
4445{
4546 fetchers::Settings fetchSettings = fetchers::Settings{};
46- fetchSettings.accessTokens .get ().insert ({" github.com/partial" ," token" });
47+ fetchSettings.accessTokens .get ().insert ({" github.com/partial" , " token" });
4748 auto i = Input::fromURL (fetchSettings, " github:partial-match/repo" );
4849
4950 auto token = i.scheme ->getAccessToken (fetchSettings, " github.com" , " github.com/partial-match" );
50- ASSERT_EQ (token,std::nullopt );
51+ ASSERT_EQ (token, std::nullopt );
5152}
5253
5354TEST_F (AccessKeysTest, repoGitHub)
5455{
5556 fetchers::Settings fetchSettings = fetchers::Settings{};
56- fetchSettings.accessTokens .get ().insert ({" github.com" ," token" });
57- fetchSettings.accessTokens .get ().insert ({" github.com/a/b" ," another_token" });
58- fetchSettings.accessTokens .get ().insert ({" github.com/a/c" ," yet_another_token" });
57+ fetchSettings.accessTokens .get ().insert ({" github.com" , " token" });
58+ fetchSettings.accessTokens .get ().insert ({" github.com/a/b" , " another_token" });
59+ fetchSettings.accessTokens .get ().insert ({" github.com/a/c" , " yet_another_token" });
5960 auto i = Input::fromURL (fetchSettings, " github:a/a" );
6061
6162 auto token = i.scheme ->getAccessToken (fetchSettings, " github.com" , " github.com/a/a" );
62- ASSERT_EQ (token," token" );
63+ ASSERT_EQ (token, " token" );
6364
6465 token = i.scheme ->getAccessToken (fetchSettings, " github.com" , " github.com/a/b" );
65- ASSERT_EQ (token," another_token" );
66+ ASSERT_EQ (token, " another_token" );
6667
6768 token = i.scheme ->getAccessToken (fetchSettings, " github.com" , " github.com/a/c" );
68- ASSERT_EQ (token," yet_another_token" );
69+ ASSERT_EQ (token, " yet_another_token" );
6970}
7071
7172TEST_F (AccessKeysTest, multipleGitLab)
7273{
7374 fetchers::Settings fetchSettings = fetchers::Settings{};
74- fetchSettings.accessTokens .get ().insert ({" gitlab.com" ," token" });
75- fetchSettings.accessTokens .get ().insert ({" gitlab.com/a/b" ," another_token" });
75+ fetchSettings.accessTokens .get ().insert ({" gitlab.com" , " token" });
76+ fetchSettings.accessTokens .get ().insert ({" gitlab.com/a/b" , " another_token" });
7677 auto i = Input::fromURL (fetchSettings, " gitlab:a/b" );
7778
7879 auto token = i.scheme ->getAccessToken (fetchSettings, " gitlab.com" , " gitlab.com/a/b" );
79- ASSERT_EQ (token," another_token" );
80+ ASSERT_EQ (token, " another_token" );
8081
8182 token = i.scheme ->getAccessToken (fetchSettings, " gitlab.com" , " gitlab.com/a/c" );
82- ASSERT_EQ (token," token" );
83+ ASSERT_EQ (token, " token" );
8384}
8485
8586TEST_F (AccessKeysTest, multipleSourceHut)
8687{
8788 fetchers::Settings fetchSettings = fetchers::Settings{};
88- fetchSettings.accessTokens .get ().insert ({" git.sr.ht" ," token" });
89- fetchSettings.accessTokens .get ().insert ({" git.sr.ht/~a/b" ," another_token" });
89+ fetchSettings.accessTokens .get ().insert ({" git.sr.ht" , " token" });
90+ fetchSettings.accessTokens .get ().insert ({" git.sr.ht/~a/b" , " another_token" });
9091 auto i = Input::fromURL (fetchSettings, " sourcehut:a/b" );
9192
9293 auto token = i.scheme ->getAccessToken (fetchSettings, " git.sr.ht" , " git.sr.ht/~a/b" );
93- ASSERT_EQ (token," another_token" );
94+ ASSERT_EQ (token, " another_token" );
9495
9596 token = i.scheme ->getAccessToken (fetchSettings, " git.sr.ht" , " git.sr.ht/~a/c" );
96- ASSERT_EQ (token," token" );
97+ ASSERT_EQ (token, " token" );
9798}
9899
99100}
0 commit comments