forked from qt-creator/qt-creator
clangbackend: Fix token length calculation
This was broken for tokens with characters that take up more than one byte. Fixes: QTCREATORBUG-25715 Change-Id: Ic9842b960af8d6f12487f582b100cb2edcf48cc1 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1807,6 +1807,12 @@ TEST_F(TokenProcessor, OperatorInTemplate)
|
||||
ASSERT_THAT(infos[9], HasOnlyType(HighlightingType::Punctuation));
|
||||
}
|
||||
|
||||
TEST_F(TokenProcessor, CyrillicString)
|
||||
{
|
||||
const auto infos = translationUnit.tokenInfosInRange(sourceRange(792, 28));
|
||||
ASSERT_THAT(infos[5], IsHighlightingMark(792u, 24u, 3u, HighlightingType::StringLiteral));
|
||||
}
|
||||
|
||||
Data *TokenProcessor::d;
|
||||
|
||||
void TokenProcessor::SetUpTestCase()
|
||||
|
||||
Reference in New Issue
Block a user