diff --git a/cpp/ycm/tests/Candidate_test.cpp b/cpp/ycm/tests/Candidate_test.cpp index a1771ed6..d772c089 100644 --- a/cpp/ycm/tests/Candidate_test.cpp +++ b/cpp/ycm/tests/Candidate_test.cpp @@ -19,41 +19,37 @@ #include "Candidate.h" #include "Result.h" -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( CandidateTest, TextValid ) -{ +TEST( CandidateTest, TextValid ) { std::string text = "foo"; Candidate candidate( text ); EXPECT_EQ( text, candidate.Text() ); } -TEST( CandidateTest, MatchesQueryBitsetWhenMatch ) -{ +TEST( CandidateTest, MatchesQueryBitsetWhenMatch ) { Candidate candidate( "foobaaar" ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "foobaaar" ) ) ); + LetterBitsetFromString( "foobaaar" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "fobar" ) ) ); + LetterBitsetFromString( "fobar" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "rabof" ) ) ); + LetterBitsetFromString( "rabof" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "bfroa" ) ) ); + LetterBitsetFromString( "bfroa" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "fbr" ) ) ); + LetterBitsetFromString( "fbr" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "r" ) ) ); + LetterBitsetFromString( "r" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "bbb" ) ) ); + LetterBitsetFromString( "bbb" ) ) ); EXPECT_TRUE( candidate.MatchesQueryBitset( - LetterBitsetFromString( "" ) ) ); + LetterBitsetFromString( "" ) ) ); } -TEST( CandidateTest, DoesntMatchQueryBitset ) -{ +TEST( CandidateTest, DoesntMatchQueryBitset ) { Candidate candidate( "foobar" ); EXPECT_FALSE( candidate.MatchesQueryBitset( @@ -68,8 +64,7 @@ TEST( CandidateTest, DoesntMatchQueryBitset ) LetterBitsetFromString( "fbrmmm" ) ) ); } -TEST( CandidateTest, QueryMatchResultIsSubsequence ) -{ +TEST( CandidateTest, QueryMatchResultIsSubsequence ) { Candidate candidate( "foobaaar" ); EXPECT_TRUE( candidate.QueryMatchResult( "foobaaar" ).IsSubsequence() ); @@ -88,8 +83,7 @@ TEST( CandidateTest, QueryMatchResultIsSubsequence ) EXPECT_TRUE( candidate.QueryMatchResult( "" ).IsSubsequence() ); } -TEST( CandidateTest, QueryMatchResultIsntSubsequence ) -{ +TEST( CandidateTest, QueryMatchResultIsntSubsequence ) { Candidate candidate( "foobaaar" ); EXPECT_FALSE( candidate.QueryMatchResult( "foobra" ).IsSubsequence() ); diff --git a/cpp/ycm/tests/ClangCompleter/ClangCompleter_test.cpp b/cpp/ycm/tests/ClangCompleter/ClangCompleter_test.cpp index 1cbd3c12..c734b964 100644 --- a/cpp/ycm/tests/ClangCompleter/ClangCompleter_test.cpp +++ b/cpp/ycm/tests/ClangCompleter/ClangCompleter_test.cpp @@ -26,29 +26,26 @@ namespace fs = boost::filesystem; using ::testing::ElementsAre; using ::testing::WhenSorted; -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( ClangCompleterTest, CandidatesForLocationInFile ) -{ +TEST( ClangCompleterTest, CandidatesForLocationInFile ) { fs::path path_to_testdata = fs::current_path() / fs::path( "testdata" ); fs::path test_file = path_to_testdata / fs::path( "basic.cpp" ); ClangCompleter completer; std::vector< CompletionData > completions = completer.CandidatesForLocationInFile( - test_file.string(), - 11, - 7, - std::vector< UnsavedFile >(), - std::vector< std::string >() ); + test_file.string(), + 11, + 7, + std::vector< UnsavedFile >(), + std::vector< std::string >() ); EXPECT_TRUE( !completions.empty() ); } -TEST( ClangCompleterTest, CandidatesForQueryAndLocationInFileAsync ) -{ +TEST( ClangCompleterTest, CandidatesForQueryAndLocationInFileAsync ) { fs::path path_to_testdata = fs::current_path() / fs::path( "testdata" ); fs::path test_file = path_to_testdata / fs::path( "basic.cpp" ); @@ -57,12 +54,12 @@ TEST( ClangCompleterTest, CandidatesForQueryAndLocationInFileAsync ) Future< AsyncCompletions > completions_future = completer.CandidatesForQueryAndLocationInFileAsync( - "", - test_file.string(), - 11, - 7, - std::vector< UnsavedFile >(), - std::vector< std::string >() ); + "", + test_file.string(), + 11, + 7, + std::vector< UnsavedFile >(), + std::vector< std::string >() ); completions_future.Wait(); diff --git a/cpp/ycm/tests/ClangCompleter/TranslationUnit_test.cpp b/cpp/ycm/tests/ClangCompleter/TranslationUnit_test.cpp index f698b2c1..d5dbc172 100644 --- a/cpp/ycm/tests/ClangCompleter/TranslationUnit_test.cpp +++ b/cpp/ycm/tests/ClangCompleter/TranslationUnit_test.cpp @@ -27,11 +27,9 @@ namespace fs = boost::filesystem; using ::testing::ElementsAre; using ::testing::WhenSorted; -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( TranslationUnitTest, ExceptionThrownOnParseFailure ) -{ +TEST( TranslationUnitTest, ExceptionThrownOnParseFailure ) { fs::path test_file = fs::temp_directory_path() / fs::unique_path(); std::string junk = "#&9112(^(^#>@(^@!@(&#@a}}}}{nthoeu\n&&^^&^&!#%%@@!aeu"; WriteUtf8File( test_file, junk ); diff --git a/cpp/ycm/tests/IdentifierCompleter_test.cpp b/cpp/ycm/tests/IdentifierCompleter_test.cpp index 23e33663..8edcd59d 100644 --- a/cpp/ycm/tests/IdentifierCompleter_test.cpp +++ b/cpp/ycm/tests/IdentifierCompleter_test.cpp @@ -24,176 +24,186 @@ using ::testing::ElementsAre; using ::testing::WhenSorted; -namespace YouCompleteMe -{ +namespace YouCompleteMe { // This differs from what we expect from the ClangCompleter. That one should // return results for an empty query. -TEST( IdentifierCompleterTest, EmptyQueryNoResults ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar" ) ).CandidatesForQuery( "" ), - ElementsAre() ); +TEST( IdentifierCompleterTest, EmptyQueryNoResults ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar" ) ).CandidatesForQuery( "" ), + ElementsAre() ); } -TEST( IdentifierCompleterTest, NoDuplicatesReturned ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar", - "foobar", - "foobar" ) ).CandidatesForQuery( "foo" ), - ElementsAre( "foobar" ) ); +TEST( IdentifierCompleterTest, NoDuplicatesReturned ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar", + "foobar", + "foobar" ) ).CandidatesForQuery( "foo" ), + ElementsAre( "foobar" ) ); } -TEST( IdentifierCompleterTest, OneCandidate ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar" ) ).CandidatesForQuery( "fbr" ), - ElementsAre( "foobar" ) ); +TEST( IdentifierCompleterTest, OneCandidate ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar" ) ).CandidatesForQuery( "fbr" ), + ElementsAre( "foobar" ) ); } -TEST( IdentifierCompleterTest, ManyCandidateSimple ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar", - "foobartest", - "Foobartest" ) ).CandidatesForQuery( "fbr" ), - WhenSorted( ElementsAre( "Foobartest", - "foobar", - "foobartest" ) ) ); +TEST( IdentifierCompleterTest, ManyCandidateSimple ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar", + "foobartest", + "Foobartest" ) ).CandidatesForQuery( "fbr" ), + WhenSorted( ElementsAre( "Foobartest", + "foobar", + "foobartest" ) ) ); } -TEST( IdentifierCompleterTest, FirstCharSameAsQueryWins ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar", - "afoobar" ) ).CandidatesForQuery( "fbr" ), - ElementsAre( "foobar", - "afoobar" ) ); +TEST( IdentifierCompleterTest, FirstCharSameAsQueryWins ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar", + "afoobar" ) ).CandidatesForQuery( "fbr" ), + ElementsAre( "foobar", + "afoobar" ) ); } -TEST( IdentifierCompleterTest, CompleteMatchForWordBoundaryCharsWins ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "FooBarQux", - "FBaqux" ) ).CandidatesForQuery( "fbq" ), - ElementsAre( "FooBarQux", - "FBaqux" ) ); +TEST( IdentifierCompleterTest, CompleteMatchForWordBoundaryCharsWins ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "FooBarQux", + "FBaqux" ) ).CandidatesForQuery( "fbq" ), + ElementsAre( "FooBarQux", + "FBaqux" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "CompleterTest", - "CompleteMatchForWordBoundaryCharsWins" ) ) - .CandidatesForQuery( "ct" ), - ElementsAre( "CompleterTest", - "CompleteMatchForWordBoundaryCharsWins" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "CompleterTest", + "CompleteMatchForWordBoundaryCharsWins" ) ) + .CandidatesForQuery( "ct" ), + ElementsAre( "CompleterTest", + "CompleteMatchForWordBoundaryCharsWins" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "FooBar", - "FooBarRux" ) ).CandidatesForQuery( "fbr" ), - ElementsAre( "FooBarRux", - "FooBar" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "FooBar", + "FooBarRux" ) ).CandidatesForQuery( "fbr" ), + ElementsAre( "FooBarRux", + "FooBar" ) ); } -TEST( IdentifierCompleterTest, RatioUtilizationTieBreak ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "aGaaFooBarQux", - "aBaafbq" ) ).CandidatesForQuery( "fbq" ), - ElementsAre( "aGaaFooBarQux", - "aBaafbq" ) ); +TEST( IdentifierCompleterTest, RatioUtilizationTieBreak ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "aGaaFooBarQux", + "aBaafbq" ) ).CandidatesForQuery( "fbq" ), + ElementsAre( "aGaaFooBarQux", + "aBaafbq" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "aFooBarQux", - "afbq" ) ).CandidatesForQuery( "fbq" ), - ElementsAre( "aFooBarQux", - "afbq" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "aFooBarQux", + "afbq" ) ).CandidatesForQuery( "fbq" ), + ElementsAre( "aFooBarQux", + "afbq" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "acaaCaaFooGxx", - "aCaafoog" ) ).CandidatesForQuery( "caafoo" ), - ElementsAre( "acaaCaaFooGxx", - "aCaafoog" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "acaaCaaFooGxx", + "aCaafoog" ) ).CandidatesForQuery( "caafoo" ), + ElementsAre( "acaaCaaFooGxx", + "aCaafoog" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "acaaCaaFooGxx", - "aCaafoog" ) ).CandidatesForQuery( "caaFoo" ), - ElementsAre( "acaaCaaFooGxx", - "aCaafoog" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "acaaCaaFooGxx", + "aCaafoog" ) ).CandidatesForQuery( "caaFoo" ), + ElementsAre( "acaaCaaFooGxx", + "aCaafoog" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "FooBarQux", - "FooBarQuxZaa" ) ).CandidatesForQuery( "fbq" ), - ElementsAre( "FooBarQux", - "FooBarQuxZaa" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "FooBarQux", + "FooBarQuxZaa" ) ).CandidatesForQuery( "fbq" ), + ElementsAre( "FooBarQux", + "FooBarQuxZaa" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "FooBar", - "FooBarRux" ) ).CandidatesForQuery( "fba" ), - ElementsAre( "FooBar", - "FooBarRux" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "FooBar", + "FooBarRux" ) ).CandidatesForQuery( "fba" ), + ElementsAre( "FooBar", + "FooBarRux" ) ); } -TEST( IdentifierCompleterTest, QueryPrefixOfCandidateWins ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar", - "fbaroo" ) ).CandidatesForQuery( "foo" ), - ElementsAre( "foobar", - "fbaroo" ) ); +TEST( IdentifierCompleterTest, QueryPrefixOfCandidateWins ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar", + "fbaroo" ) ).CandidatesForQuery( "foo" ), + ElementsAre( "foobar", + "fbaroo" ) ); } -TEST( IdentifierCompleterTest, LowerMatchCharIndexSumWins ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "ratio_of_word_boundary_chars_in_query_", - "first_char_same_in_query_and_text_") ) - .CandidatesForQuery( "charinq" ), - ElementsAre( "first_char_same_in_query_and_text_", - "ratio_of_word_boundary_chars_in_query_") ); +TEST( IdentifierCompleterTest, LowerMatchCharIndexSumWins ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "ratio_of_word_boundary_chars_in_query_", + "first_char_same_in_query_and_text_" ) ) + .CandidatesForQuery( "charinq" ), + ElementsAre( "first_char_same_in_query_and_text_", + "ratio_of_word_boundary_chars_in_query_" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "barfooq", - "barquxfoo" ) ).CandidatesForQuery( "foo" ), - ElementsAre( "barfooq", - "barquxfoo") ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "barfooq", + "barquxfoo" ) ).CandidatesForQuery( "foo" ), + ElementsAre( "barfooq", + "barquxfoo" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "xxxxxxabc", - "xxabcxxxx" ) ).CandidatesForQuery( "abc" ), - ElementsAre( "xxabcxxxx", - "xxxxxxabc") ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "xxxxxxabc", + "xxabcxxxx" ) ).CandidatesForQuery( "abc" ), + ElementsAre( "xxabcxxxx", + "xxxxxxabc" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "FooBarQux", - "FaBarQux" ) ).CandidatesForQuery( "fbq" ), - ElementsAre( "FaBarQux", - "FooBarQux" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "FooBarQux", + "FaBarQux" ) ).CandidatesForQuery( "fbq" ), + ElementsAre( "FaBarQux", + "FooBarQux" ) ); } -TEST( IdentifierCompleterTest, ShorterCandidateWins ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "CompleterT", - "CompleterTest" ) ).CandidatesForQuery( "co" ), - ElementsAre( "CompleterT", - "CompleterTest" ) ); +TEST( IdentifierCompleterTest, ShorterCandidateWins ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "CompleterT", + "CompleterTest" ) ).CandidatesForQuery( "co" ), + ElementsAre( "CompleterT", + "CompleterTest" ) ); - EXPECT_THAT( IdentifierCompleter( StringVector( - "CompleterT", - "CompleterTest" ) ).CandidatesForQuery( "plet" ), - ElementsAre( "CompleterT", - "CompleterTest" ) ); + EXPECT_THAT( IdentifierCompleter( + StringVector( + "CompleterT", + "CompleterTest" ) ).CandidatesForQuery( "plet" ), + ElementsAre( "CompleterT", + "CompleterTest" ) ); } -TEST( IdentifierCompleterTest, SameLowercaseCandidateWins ) -{ - EXPECT_THAT( IdentifierCompleter( StringVector( - "foobar", - "Foobar" ) ).CandidatesForQuery( "foo" ), - ElementsAre( "foobar", - "Foobar" ) ); +TEST( IdentifierCompleterTest, SameLowercaseCandidateWins ) { + EXPECT_THAT( IdentifierCompleter( + StringVector( + "foobar", + "Foobar" ) ).CandidatesForQuery( "foo" ), + ElementsAre( "foobar", + "Foobar" ) ); } // TODO: tests for filepath and filetype candidate storing diff --git a/cpp/ycm/tests/IdentifierUtils_test.cpp b/cpp/ycm/tests/IdentifierUtils_test.cpp index 822fa284..04f16a57 100644 --- a/cpp/ycm/tests/IdentifierUtils_test.cpp +++ b/cpp/ycm/tests/IdentifierUtils_test.cpp @@ -22,75 +22,72 @@ using ::testing::ElementsAre; using ::testing::WhenSorted; -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( IdentifierUtilsTest, RemoveIdentifierFreeTextWorks ) -{ - EXPECT_STREQ( RemoveIdentifierFreeText( - "foo \n" - "bar //foo \n" - "qux" - ).c_str(), - "foo \n" - "bar \n" - "qux" ); +TEST( IdentifierUtilsTest, RemoveIdentifierFreeTextWorks ) { + EXPECT_STREQ( RemoveIdentifierFreeText( + "foo \n" + "bar //foo \n" + "qux" + ).c_str(), + "foo \n" + "bar \n" + "qux" ); - EXPECT_STREQ( RemoveIdentifierFreeText( - "foo \n" - "bar #foo \n" - "qux" - ).c_str(), - "foo \n" - "bar \n" - "qux" ); + EXPECT_STREQ( RemoveIdentifierFreeText( + "foo \n" + "bar #foo \n" + "qux" + ).c_str(), + "foo \n" + "bar \n" + "qux" ); - EXPECT_STREQ( RemoveIdentifierFreeText( - "foo \n" - "bar /* foo \n" - " foo2 */\n" - "qux" - ).c_str(), - "foo \n" - "bar \n" - "qux" ); + EXPECT_STREQ( RemoveIdentifierFreeText( + "foo \n" + "bar /* foo \n" + " foo2 */\n" + "qux" + ).c_str(), + "foo \n" + "bar \n" + "qux" ); - EXPECT_STREQ( RemoveIdentifierFreeText( - "foo \n" - "bar 'foo'\n" - "qux" - ).c_str(), - "foo \n" - "bar \n" - "qux" ); + EXPECT_STREQ( RemoveIdentifierFreeText( + "foo \n" + "bar 'foo'\n" + "qux" + ).c_str(), + "foo \n" + "bar \n" + "qux" ); - EXPECT_STREQ( RemoveIdentifierFreeText( - "foo \n" - "bar \"foo\"\n" - "qux" - ).c_str(), - "foo \n" - "bar \n" - "qux" ); + EXPECT_STREQ( RemoveIdentifierFreeText( + "foo \n" + "bar \"foo\"\n" + "qux" + ).c_str(), + "foo \n" + "bar \n" + "qux" ); } -TEST( IdentifierUtilsTest, ExtractIdentifiersFromTextWorks ) -{ - EXPECT_THAT( ExtractIdentifiersFromText( - "foo $_bar \n&BazGoo\n FOO= !!! '-' - _ (x) one-two !moo [qqq]" - ), - ElementsAre( "foo", - "_bar", - "BazGoo", - "FOO", - "_", - "x", - "one", - "two", - "moo", - "qqq" ) ); +TEST( IdentifierUtilsTest, ExtractIdentifiersFromTextWorks ) { + EXPECT_THAT( ExtractIdentifiersFromText( + "foo $_bar \n&BazGoo\n FOO= !!! '-' - _ (x) one-two !moo [qqq]" + ), + ElementsAre( "foo", + "_bar", + "BazGoo", + "FOO", + "_", + "x", + "one", + "two", + "moo", + "qqq" ) ); } diff --git a/cpp/ycm/tests/IndexForChar_test.cpp b/cpp/ycm/tests/IndexForChar_test.cpp index 21d81a38..133c8dc9 100644 --- a/cpp/ycm/tests/IndexForChar_test.cpp +++ b/cpp/ycm/tests/IndexForChar_test.cpp @@ -18,11 +18,9 @@ #include #include "LetterNodeListMap.h" -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( IndexForCharTest, Basic ) -{ +TEST( IndexForCharTest, Basic ) { EXPECT_EQ( static_cast( 'a' ), IndexForChar( 'a' ) ); EXPECT_EQ( static_cast( 'a' ), IndexForChar( 'A' ) ); EXPECT_EQ( static_cast( 'z' ), IndexForChar( 'z' ) ); diff --git a/cpp/ycm/tests/IsUppercase_test.cpp b/cpp/ycm/tests/IsUppercase_test.cpp index 053fdcbe..088ca61d 100644 --- a/cpp/ycm/tests/IsUppercase_test.cpp +++ b/cpp/ycm/tests/IsUppercase_test.cpp @@ -18,11 +18,9 @@ #include #include "LetterNodeListMap.h" -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( IsUppercaseTest, Basic ) -{ +TEST( IsUppercaseTest, Basic ) { EXPECT_TRUE( IsUppercase( 'A' ) ); EXPECT_TRUE( IsUppercase( 'B' ) ); EXPECT_TRUE( IsUppercase( 'Z' ) ); diff --git a/cpp/ycm/tests/LetterBitsetFromString_test.cpp b/cpp/ycm/tests/LetterBitsetFromString_test.cpp index 1408896e..147bc503 100644 --- a/cpp/ycm/tests/LetterBitsetFromString_test.cpp +++ b/cpp/ycm/tests/LetterBitsetFromString_test.cpp @@ -18,11 +18,9 @@ #include #include "Candidate.h" -namespace YouCompleteMe -{ +namespace YouCompleteMe { -TEST( LetterBitsetFromStringTest, Basic ) -{ +TEST( LetterBitsetFromStringTest, Basic ) { Bitset expected; expected.set( IndexForChar( 'a' ) ); expected.set( IndexForChar( 'o' ) ); diff --git a/cpp/ycm/tests/TestUtils.cpp b/cpp/ycm/tests/TestUtils.cpp index ded977f2..87547cbd 100644 --- a/cpp/ycm/tests/TestUtils.cpp +++ b/cpp/ycm/tests/TestUtils.cpp @@ -17,8 +17,7 @@ #include "TestUtils.h" -namespace YouCompleteMe -{ +namespace YouCompleteMe { std::vector< std::string > StringVector( const std::string &a, const std::string &b, @@ -28,25 +27,32 @@ std::vector< std::string > StringVector( const std::string &a, const std::string &f, const std::string &g, const std::string &h, - const std::string &i ) -{ + const std::string &i ) { std::vector< std::string > string_vector; - string_vector.push_back( a ); - if ( !b.empty() ) + string_vector.push_back( a ); + + if ( !b.empty() ) string_vector.push_back( b ); - if ( !c.empty() ) + + if ( !c.empty() ) string_vector.push_back( c ); - if ( !d.empty() ) + + if ( !d.empty() ) string_vector.push_back( d ); - if ( !e.empty() ) + + if ( !e.empty() ) string_vector.push_back( e ); - if ( !f.empty() ) + + if ( !f.empty() ) string_vector.push_back( f ); - if ( !g.empty() ) + + if ( !g.empty() ) string_vector.push_back( g ); - if ( !h.empty() ) + + if ( !h.empty() ) string_vector.push_back( h ); - if ( !i.empty() ) + + if ( !i.empty() ) string_vector.push_back( i ); return string_vector; diff --git a/cpp/ycm/tests/TestUtils.h b/cpp/ycm/tests/TestUtils.h index a6ba19dd..546b85c1 100644 --- a/cpp/ycm/tests/TestUtils.h +++ b/cpp/ycm/tests/TestUtils.h @@ -21,8 +21,7 @@ #include #include -namespace YouCompleteMe -{ +namespace YouCompleteMe { std::vector< std::string > StringVector( const std::string &a, const std::string &b = std::string(),