Update clang-format to 16.0.0.
This commit is contained in:
parent
a08b1f9107
commit
7eee3f469a
@ -4,15 +4,36 @@ Language: Cpp
|
|||||||
AccessModifierOffset: -1
|
AccessModifierOffset: -1
|
||||||
AlignAfterOpenBracket: Align
|
AlignAfterOpenBracket: Align
|
||||||
AlignArrayOfStructures: None
|
AlignArrayOfStructures: None
|
||||||
AlignConsecutiveMacros: None
|
AlignConsecutiveAssignments:
|
||||||
AlignConsecutiveAssignments: None
|
Enabled: false
|
||||||
AlignConsecutiveBitFields: None
|
AcrossEmptyLines: false
|
||||||
AlignConsecutiveDeclarations: None
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
PadOperators: true
|
||||||
|
AlignConsecutiveBitFields:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
PadOperators: false
|
||||||
|
AlignConsecutiveDeclarations:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
PadOperators: false
|
||||||
|
AlignConsecutiveMacros:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
PadOperators: false
|
||||||
AlignEscapedNewlines: Left
|
AlignEscapedNewlines: Left
|
||||||
AlignOperands: Align
|
AlignOperands: Align
|
||||||
AlignTrailingComments: true
|
AlignTrailingComments:
|
||||||
|
Kind: Always
|
||||||
|
OverEmptyLines: 0
|
||||||
AllowAllArgumentsOnNextLine: true
|
AllowAllArgumentsOnNextLine: true
|
||||||
AllowAllConstructorInitializersOnNextLine: true
|
|
||||||
AllowAllParametersOfDeclarationOnNextLine: true
|
AllowAllParametersOfDeclarationOnNextLine: true
|
||||||
AllowShortBlocksOnASingleLine: Never
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
@ -25,6 +46,8 @@ AlwaysBreakAfterDefinitionReturnType: None
|
|||||||
AlwaysBreakAfterReturnType: None
|
AlwaysBreakAfterReturnType: None
|
||||||
AlwaysBreakBeforeMultilineStrings: true
|
AlwaysBreakBeforeMultilineStrings: true
|
||||||
AlwaysBreakTemplateDeclarations: Yes
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
# AttributeMacros:
|
||||||
|
# - __capability
|
||||||
BinPackArguments: true
|
BinPackArguments: true
|
||||||
BinPackParameters: true
|
BinPackParameters: true
|
||||||
BitFieldColonSpacing: Both
|
BitFieldColonSpacing: Both
|
||||||
@ -33,12 +56,12 @@ BraceWrapping:
|
|||||||
AfterClass: false
|
AfterClass: false
|
||||||
AfterControlStatement: Never
|
AfterControlStatement: Never
|
||||||
AfterEnum: false
|
AfterEnum: false
|
||||||
|
AfterExternBlock: false
|
||||||
AfterFunction: false
|
AfterFunction: false
|
||||||
AfterNamespace: false
|
AfterNamespace: false
|
||||||
AfterObjCDeclaration: false
|
AfterObjCDeclaration: false
|
||||||
AfterStruct: false
|
AfterStruct: false
|
||||||
AfterUnion: false
|
AfterUnion: false
|
||||||
AfterExternBlock: false
|
|
||||||
BeforeCatch: false
|
BeforeCatch: false
|
||||||
BeforeElse: false
|
BeforeElse: false
|
||||||
BeforeLambdaBody: false
|
BeforeLambdaBody: false
|
||||||
@ -47,24 +70,23 @@ BraceWrapping:
|
|||||||
SplitEmptyFunction: true
|
SplitEmptyFunction: true
|
||||||
SplitEmptyRecord: true
|
SplitEmptyRecord: true
|
||||||
SplitEmptyNamespace: true
|
SplitEmptyNamespace: true
|
||||||
|
BreakAfterAttributes: Never
|
||||||
|
# BreakAfterJavaFieldAnnotations: false
|
||||||
|
BreakArrays: true
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
BreakBeforeBraces: Attach
|
BreakBeforeBraces: Attach
|
||||||
BreakBeforeConceptDeclarations: true
|
BreakBeforeConceptDeclarations: Always
|
||||||
BreakBeforeInheritanceComma: true # false
|
BreakBeforeInlineASMColon: OnlyMultiline
|
||||||
BreakInheritanceList: BeforeComma # BeforeColon
|
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
BreakConstructorInitializersBeforeComma: true # false
|
|
||||||
BreakConstructorInitializers: BeforeComma # BeforeColon
|
BreakConstructorInitializers: BeforeComma # BeforeColon
|
||||||
# BreakAfterJavaFieldAnnotations: false
|
BreakInheritanceList: BeforeComma # BeforeColon
|
||||||
BreakStringLiterals: true
|
BreakStringLiterals: true
|
||||||
ColumnLimit: 120 # 80
|
ColumnLimit: 120 # 80
|
||||||
CommentPragmas: '^ IWYU pragma:'
|
CommentPragmas: '^ IWYU pragma:'
|
||||||
CompactNamespaces: false
|
CompactNamespaces: false
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|
||||||
ConstructorInitializerIndentWidth: 4
|
ConstructorInitializerIndentWidth: 4
|
||||||
ContinuationIndentWidth: 4
|
ContinuationIndentWidth: 4
|
||||||
Cpp11BracedListStyle: true
|
Cpp11BracedListStyle: true
|
||||||
DeriveLineEnding: true
|
|
||||||
DerivePointerAlignment: true
|
DerivePointerAlignment: true
|
||||||
DisableFormat: false
|
DisableFormat: false
|
||||||
EmptyLineAfterAccessModifier: Never
|
EmptyLineAfterAccessModifier: Never
|
||||||
@ -83,14 +105,21 @@ IndentCaseLabels: true
|
|||||||
IndentExternBlock: AfterExternBlock
|
IndentExternBlock: AfterExternBlock
|
||||||
IndentGotoLabels: true
|
IndentGotoLabels: true
|
||||||
IndentPPDirectives: None
|
IndentPPDirectives: None
|
||||||
IndentRequires: false
|
IndentRequiresClause: true
|
||||||
IndentWidth: 2
|
IndentWidth: 2
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
|
InsertBraces: false
|
||||||
|
InsertNewlineAtEOF: false
|
||||||
# InsertTrailingCommas: None
|
# InsertTrailingCommas: None
|
||||||
|
IntegerLiteralSeparator:
|
||||||
|
Binary: 0
|
||||||
|
Decimal: 0
|
||||||
|
Hex: 0
|
||||||
# JavaScriptQuotes: Leave
|
# JavaScriptQuotes: Leave
|
||||||
# JavaScriptWrapImports: true
|
# JavaScriptWrapImports: true
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
LambdaBodyIndentation: Signature
|
LambdaBodyIndentation: Signature
|
||||||
|
LineEnding: DeriveLF
|
||||||
MacroBlockBegin: ''
|
MacroBlockBegin: ''
|
||||||
MacroBlockEnd: ''
|
MacroBlockEnd: ''
|
||||||
MaxEmptyLinesToKeep: 1
|
MaxEmptyLinesToKeep: 1
|
||||||
@ -100,23 +129,31 @@ NamespaceIndentation: None
|
|||||||
# ObjCBreakBeforeNestedBlockParam: true
|
# ObjCBreakBeforeNestedBlockParam: true
|
||||||
# ObjCSpaceAfterProperty: false
|
# ObjCSpaceAfterProperty: false
|
||||||
# ObjCSpaceBeforeProtocolList: true
|
# ObjCSpaceBeforeProtocolList: true
|
||||||
|
PackConstructorInitializers: NextLine
|
||||||
PenaltyBreakAssignment: 2
|
PenaltyBreakAssignment: 2
|
||||||
PenaltyBreakBeforeFirstCallParameter: 1
|
PenaltyBreakBeforeFirstCallParameter: 1
|
||||||
PenaltyBreakComment: 300
|
PenaltyBreakComment: 300
|
||||||
PenaltyBreakFirstLessLess: 120
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakOpenParenthesis: 0
|
||||||
PenaltyBreakString: 1000
|
PenaltyBreakString: 1000
|
||||||
PenaltyBreakTemplateDeclaration: 10
|
PenaltyBreakTemplateDeclaration: 10
|
||||||
PenaltyExcessCharacter: 1000000
|
PenaltyExcessCharacter: 1000000
|
||||||
PenaltyIndentedWhitespace: 0
|
PenaltyIndentedWhitespace: 0
|
||||||
PenaltyReturnTypeOnItsOwnLine: 200
|
PenaltyReturnTypeOnItsOwnLine: 200
|
||||||
PointerAlignment: Right
|
PointerAlignment: Right # Left
|
||||||
PPIndentWidth: -1
|
PPIndentWidth: -1
|
||||||
|
QualifierAlignment: Leave
|
||||||
ReferenceAlignment: Pointer
|
ReferenceAlignment: Pointer
|
||||||
ReflowComments: false # true
|
ReflowComments: false # true
|
||||||
|
RemoveBracesLLVM: false
|
||||||
|
RemoveSemicolon: false
|
||||||
|
RequiresClausePosition: OwnLine
|
||||||
|
RequiresExpressionIndentation: OuterScope
|
||||||
|
SeparateDefinitionBlocks: Leave
|
||||||
ShortNamespaceLines: 0 # 1
|
ShortNamespaceLines: 0 # 1
|
||||||
SortIncludes: CaseInsensitive # CaseSensitive
|
SortIncludes: CaseInsensitive # CaseSensitive
|
||||||
# SortJavaStaticImport: Before
|
# SortJavaStaticImport: Before
|
||||||
SortUsingDeclarations: false # true
|
SortUsingDeclarations: Lexicographic # LexicographicNumeric
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
SpaceAfterLogicalNot: false
|
SpaceAfterLogicalNot: false
|
||||||
SpaceAfterTemplateKeyword: true
|
SpaceAfterTemplateKeyword: true
|
||||||
@ -127,6 +164,16 @@ SpaceBeforeCpp11BracedList: false
|
|||||||
SpaceBeforeCtorInitializerColon: true
|
SpaceBeforeCtorInitializerColon: true
|
||||||
SpaceBeforeInheritanceColon: true
|
SpaceBeforeInheritanceColon: true
|
||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeParensOptions:
|
||||||
|
AfterControlStatements: true
|
||||||
|
AfterForeachMacros: true
|
||||||
|
AfterFunctionDefinitionName: false
|
||||||
|
AfterFunctionDeclarationName: false
|
||||||
|
AfterIfMacros: true
|
||||||
|
AfterOverloadedOperator: false
|
||||||
|
AfterRequiresInClause: false
|
||||||
|
AfterRequiresInExpression: false
|
||||||
|
BeforeNonEmptyParentheses: false
|
||||||
SpaceBeforeRangeBasedForLoopColon: true
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
SpaceBeforeSquareBrackets: false
|
SpaceBeforeSquareBrackets: false
|
||||||
SpaceInEmptyBlock: false
|
SpaceInEmptyBlock: false
|
||||||
@ -143,6 +190,5 @@ SpacesInParentheses: false
|
|||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Auto
|
Standard: Auto
|
||||||
TabWidth: 100 # 8
|
TabWidth: 100 # 8
|
||||||
UseCRLF: false
|
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
...
|
...
|
||||||
|
@ -277,11 +277,9 @@ void AutosaveManager::load_autosave_settings(Promise<td_api::object_ptr<td_api::
|
|||||||
|
|
||||||
if (G()->parameters().use_message_db) {
|
if (G()->parameters().use_message_db) {
|
||||||
G()->td_db()->get_sqlite_pmc()->get(
|
G()->td_db()->get_sqlite_pmc()->get(
|
||||||
get_autosave_settings_database_key(),
|
get_autosave_settings_database_key(), PromiseCreator::lambda([actor_id = actor_id(this)](string value) mutable {
|
||||||
PromiseCreator::lambda(
|
send_closure(actor_id, &AutosaveManager::on_load_autosave_settings_from_database, std::move(value));
|
||||||
[actor_id = actor_id(this)](string value) mutable {
|
}));
|
||||||
send_closure(actor_id, &AutosaveManager::on_load_autosave_settings_from_database, std::move(value));
|
|
||||||
}));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1621,8 +1621,7 @@ void StickersManager::init() {
|
|||||||
load_special_sticker_set_info_from_binlog(sticker_set);
|
load_special_sticker_set_info_from_binlog(sticker_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
dice_emojis_str_ =
|
dice_emojis_str_ = td_->option_manager_->get_option_string("dice_emojis", "π²\x01π―\x01π\x01β½\x01β½οΈ\x01π°\x01π³");
|
||||||
td_->option_manager_->get_option_string("dice_emojis", "π²\x01π―\x01π\x01β½\x01β½οΈ\x01π°\x01π³");
|
|
||||||
dice_emojis_ = full_split(dice_emojis_str_, '\x01');
|
dice_emojis_ = full_split(dice_emojis_str_, '\x01');
|
||||||
for (auto &dice_emoji : dice_emojis_) {
|
for (auto &dice_emoji : dice_emojis_) {
|
||||||
auto &animated_dice_sticker_set = add_special_sticker_set(SpecialStickerSetType::animated_dice(dice_emoji));
|
auto &animated_dice_sticker_set = add_special_sticker_set(SpecialStickerSetType::animated_dice(dice_emoji));
|
||||||
|
@ -24,7 +24,7 @@ class As {
|
|||||||
As(const As &new_value) = delete;
|
As(const As &new_value) = delete;
|
||||||
As &operator=(const As &) = delete;
|
As &operator=(const As &) = delete;
|
||||||
As(As &&) = default;
|
As(As &&) = default;
|
||||||
As &operator=(As &&new_value) &&noexcept {
|
As &operator=(As &&new_value) && noexcept {
|
||||||
std::memcpy(ptr_, new_value.ptr_, sizeof(T));
|
std::memcpy(ptr_, new_value.ptr_, sizeof(T));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ constexpr size_t member_function_argument_count() {
|
|||||||
|
|
||||||
// there is no std::is_trivially_copyable in libstdc++ before 5.0
|
// there is no std::is_trivially_copyable in libstdc++ before 5.0
|
||||||
#if __GLIBCXX__
|
#if __GLIBCXX__
|
||||||
#if TD_CLANG || (TD_GCC && __GNUC__ >= 5) // but clang >= 3.0 and g++ >= 5.0 supports __is_trivially_copyable
|
#if TD_CLANG || (TD_GCC && __GNUC__ >= 5) // but clang >= 3.0 and g++ >= 5.0 supports __is_trivially_copyable
|
||||||
#define TD_IS_TRIVIALLY_COPYABLE(T) __is_trivially_copyable(T)
|
#define TD_IS_TRIVIALLY_COPYABLE(T) __is_trivially_copyable(T)
|
||||||
#else
|
#else
|
||||||
#define TD_IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
|
#define TD_IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
|
||||||
|
@ -1250,67 +1250,50 @@ TEST(MessageEntities, parse_html) {
|
|||||||
check_parse_html("π π<</", "Unexpected end tag at byte offset 13");
|
check_parse_html("π π<</", "Unexpected end tag at byte offset 13");
|
||||||
check_parse_html("π π<<b></b></", "Unexpected end tag at byte offset 20");
|
check_parse_html("π π<<b></b></", "Unexpected end tag at byte offset 20");
|
||||||
check_parse_html("π π<<i>a</i ", "Unclosed end tag at byte offset 17");
|
check_parse_html("π π<<i>a</i ", "Unclosed end tag at byte offset 17");
|
||||||
check_parse_html("π π<<i>a</em >",
|
check_parse_html("π π<<i>a</em >", "Unmatched end tag at byte offset 17, expected \"</i>\", found \"</em>\"");
|
||||||
"Unmatched end tag at byte offset 17, expected \"</i>\", found \"</em>\"");
|
|
||||||
|
|
||||||
check_parse_html("", "", {});
|
check_parse_html("", "", {});
|
||||||
check_parse_html("β‘οΈ β‘οΈ", "β‘οΈ β‘οΈ", {});
|
check_parse_html("β‘οΈ β‘οΈ", "β‘οΈ β‘οΈ", {});
|
||||||
check_parse_html("≥<>&"«»�", "≥<>&\"«»�", {});
|
check_parse_html("≥<>&"«»�", "≥<>&\"«»�", {});
|
||||||
check_parse_html("⩔", "⩔", {});
|
check_parse_html("⩔", "⩔", {});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<i>β‘οΈ β‘οΈ</i>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_html("β‘οΈ β‘οΈ<i>β‘οΈ β‘οΈ</i>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Italic, 5, 5}});
|
||||||
{{td::MessageEntity::Type::Italic, 5, 5}});
|
check_parse_html("β‘οΈ β‘οΈ<em>β‘οΈ β‘οΈ</em>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Italic, 5, 5}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<em>β‘οΈ β‘οΈ</em>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_html("β‘οΈ β‘οΈ<b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Bold, 5, 5}});
|
||||||
{{td::MessageEntity::Type::Italic, 5, 5}});
|
check_parse_html("β‘οΈ β‘οΈ<strong>β‘οΈ β‘οΈ</strong>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Bold, 5, 5}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_html("β‘οΈ β‘οΈ<u>β‘οΈ β‘οΈ</u>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Underline, 5, 5}});
|
||||||
{{td::MessageEntity::Type::Bold, 5, 5}});
|
check_parse_html("β‘οΈ β‘οΈ<ins>β‘οΈ β‘οΈ</ins>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Underline, 5, 5}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<strong>β‘οΈ β‘οΈ</strong>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_html("β‘οΈ β‘οΈ<s>β‘οΈ β‘οΈ</s>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Strikethrough, 5, 5}});
|
||||||
{{td::MessageEntity::Type::Bold, 5, 5}});
|
check_parse_html("β‘οΈ β‘οΈ<strike>β‘οΈ β‘οΈ</strike>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Strikethrough, 5, 5}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<u>β‘οΈ β‘οΈ</u>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_html("β‘οΈ β‘οΈ<del>β‘οΈ β‘οΈ</del>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Strikethrough, 5, 5}});
|
||||||
{{td::MessageEntity::Type::Underline, 5, 5}});
|
|
||||||
check_parse_html("β‘οΈ β‘οΈ<ins>β‘οΈ β‘οΈ</ins>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::Underline, 5, 5}});
|
|
||||||
check_parse_html("β‘οΈ β‘οΈ<s>β‘οΈ β‘οΈ</s>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::Strikethrough, 5, 5}});
|
|
||||||
check_parse_html("β‘οΈ β‘οΈ<strike>β‘οΈ β‘οΈ</strike>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::Strikethrough, 5, 5}});
|
|
||||||
check_parse_html("β‘οΈ β‘οΈ<del>β‘οΈ β‘οΈ</del>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::Strikethrough, 5, 5}});
|
|
||||||
check_parse_html("β‘οΈ β‘οΈ<i>β‘οΈ β‘οΈ</i><b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_html("β‘οΈ β‘οΈ<i>β‘οΈ β‘οΈ</i><b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
||||||
{{td::MessageEntity::Type::Italic, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
{{td::MessageEntity::Type::Italic, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
||||||
check_parse_html("π π<i>π <π</i>", "π ππ <π", {{td::MessageEntity::Type::Italic, 5, 6}});
|
check_parse_html("π π<i>π <π</i>", "π ππ <π", {{td::MessageEntity::Type::Italic, 5, 6}});
|
||||||
check_parse_html("π π<i>π ><b aba = caba><π</b></i>", "π ππ ><π",
|
check_parse_html("π π<i>π ><b aba = caba><π</b></i>", "π ππ ><π",
|
||||||
{{td::MessageEntity::Type::Italic, 5, 7}, {td::MessageEntity::Type::Bold, 9, 3}});
|
{{td::MessageEntity::Type::Italic, 5, 7}, {td::MessageEntity::Type::Bold, 9, 3}});
|
||||||
check_parse_html("π π<<i aba = 190azAz-. >a</i>", "π π<a",
|
check_parse_html("π π<<i aba = 190azAz-. >a</i>", "π π<a", {{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
{{td::MessageEntity::Type::Italic, 6, 1}});
|
check_parse_html("π π<<i aba = 190azAz-.>a</i>", "π π<a", {{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
check_parse_html("π π<<i aba = 190azAz-.>a</i>", "π π<a",
|
|
||||||
{{td::MessageEntity::Type::Italic, 6, 1}});
|
|
||||||
check_parse_html("π π<<i aba = \"<>"\">a</i>", "π π<a",
|
check_parse_html("π π<<i aba = \"<>"\">a</i>", "π π<a",
|
||||||
{{td::MessageEntity::Type::Italic, 6, 1}});
|
{{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
check_parse_html("π π<<i aba = '<>"'>a</i>", "π π<a",
|
check_parse_html("π π<<i aba = '<>"'>a</i>", "π π<a",
|
||||||
{{td::MessageEntity::Type::Italic, 6, 1}});
|
{{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
check_parse_html("π π<<i aba = '<>"'>a</>", "π π<a",
|
check_parse_html("π π<<i aba = '<>"'>a</>", "π π<a",
|
||||||
{{td::MessageEntity::Type::Italic, 6, 1}});
|
{{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
check_parse_html("π π<<i>π π<</>", "π π<π π<",
|
check_parse_html("π π<<i>π π<</>", "π π<π π<", {{td::MessageEntity::Type::Italic, 6, 6}});
|
||||||
{{td::MessageEntity::Type::Italic, 6, 6}});
|
|
||||||
check_parse_html("π π<<i>a</ >", "π π<a", {{td::MessageEntity::Type::Italic, 6, 1}});
|
check_parse_html("π π<<i>a</ >", "π π<a", {{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
check_parse_html("π π<<i>a</i >", "π π<a", {{td::MessageEntity::Type::Italic, 6, 1}});
|
check_parse_html("π π<<i>a</i >", "π π<a", {{td::MessageEntity::Type::Italic, 6, 1}});
|
||||||
check_parse_html("π π<<b></b>", "π π<", {});
|
check_parse_html("π π<<b></b>", "π π<", {});
|
||||||
check_parse_html("<i>\t</i>", "\t", {{td::MessageEntity::Type::Italic, 0, 1}});
|
check_parse_html("<i>\t</i>", "\t", {{td::MessageEntity::Type::Italic, 0, 1}});
|
||||||
check_parse_html("<i>\r</i>", "\r", {{td::MessageEntity::Type::Italic, 0, 1}});
|
check_parse_html("<i>\r</i>", "\r", {{td::MessageEntity::Type::Italic, 0, 1}});
|
||||||
check_parse_html("<i>\n</i>", "\n", {{td::MessageEntity::Type::Italic, 0, 1}});
|
check_parse_html("<i>\n</i>", "\n", {{td::MessageEntity::Type::Italic, 0, 1}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<span class = \"tg-spoiler\">β‘οΈ β‘οΈ</span><b>β‘οΈ β‘οΈ</b>",
|
check_parse_html("β‘οΈ β‘οΈ<span class = \"tg-spoiler\">β‘οΈ β‘οΈ</span><b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
||||||
"β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::Spoiler, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
{{td::MessageEntity::Type::Spoiler, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
||||||
check_parse_html("π π<span class=\"tg-spoiler\">π <π</span>", "π ππ <π",
|
check_parse_html("π π<span class=\"tg-spoiler\">π <π</span>", "π ππ <π",
|
||||||
{{td::MessageEntity::Type::Spoiler, 5, 6}});
|
{{td::MessageEntity::Type::Spoiler, 5, 6}});
|
||||||
check_parse_html("π π<span class=\"tg-spoiler\">π ><b aba = caba><π</b></span>",
|
check_parse_html("π π<span class=\"tg-spoiler\">π ><b aba = caba><π</b></span>", "π ππ ><π",
|
||||||
"π ππ ><π",
|
|
||||||
{{td::MessageEntity::Type::Spoiler, 5, 7}, {td::MessageEntity::Type::Bold, 9, 3}});
|
{{td::MessageEntity::Type::Spoiler, 5, 7}, {td::MessageEntity::Type::Bold, 9, 3}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<tg-spoiler>β‘οΈ β‘οΈ</tg-spoiler><b>β‘οΈ β‘οΈ</b>",
|
check_parse_html("β‘οΈ β‘οΈ<tg-spoiler>β‘οΈ β‘οΈ</tg-spoiler><b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
||||||
"β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::Spoiler, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
{{td::MessageEntity::Type::Spoiler, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
||||||
check_parse_html("π π<tg-spoiler>π <π</tg-spoiler>", "π ππ <π",
|
check_parse_html("π π<tg-spoiler>π <π</tg-spoiler>", "π ππ <π", {{td::MessageEntity::Type::Spoiler, 5, 6}});
|
||||||
{{td::MessageEntity::Type::Spoiler, 5, 6}});
|
|
||||||
check_parse_html("π π<tg-spoiler>π ><b aba = caba><π</b></tg-spoiler>", "π ππ ><π",
|
check_parse_html("π π<tg-spoiler>π ><b aba = caba><π</b></tg-spoiler>", "π ππ ><π",
|
||||||
{{td::MessageEntity::Type::Spoiler, 5, 7}, {td::MessageEntity::Type::Bold, 9, 3}});
|
{{td::MessageEntity::Type::Spoiler, 5, 7}, {td::MessageEntity::Type::Bold, 9, 3}});
|
||||||
check_parse_html("<a href=telegram.org>\t</a>", "\t",
|
check_parse_html("<a href=telegram.org>\t</a>", "\t",
|
||||||
@ -1344,10 +1327,8 @@ TEST(MessageEntities, parse_html) {
|
|||||||
{{td::MessageEntity::Type::TextUrl, 0, 12, "http://telegram.org/"}});
|
{{td::MessageEntity::Type::TextUrl, 0, 12, "http://telegram.org/"}});
|
||||||
check_parse_html("<a>https://telegram.org/asdsa?asdasdwe#12e3we</a>", "https://telegram.org/asdsa?asdasdwe#12e3we",
|
check_parse_html("<a>https://telegram.org/asdsa?asdasdwe#12e3we</a>", "https://telegram.org/asdsa?asdasdwe#12e3we",
|
||||||
{{td::MessageEntity::Type::TextUrl, 0, 42, "https://telegram.org/asdsa?asdasdwe#12e3we"}});
|
{{td::MessageEntity::Type::TextUrl, 0, 42, "https://telegram.org/asdsa?asdasdwe#12e3we"}});
|
||||||
check_parse_html("π π<<pre >π π<</>", "π π<π π<",
|
check_parse_html("π π<<pre >π π<</>", "π π<π π<", {{td::MessageEntity::Type::Pre, 6, 6}});
|
||||||
{{td::MessageEntity::Type::Pre, 6, 6}});
|
check_parse_html("π π<<code >π π<</>", "π π<π π<", {{td::MessageEntity::Type::Code, 6, 6}});
|
||||||
check_parse_html("π π<<code >π π<</>", "π π<π π<",
|
|
||||||
{{td::MessageEntity::Type::Code, 6, 6}});
|
|
||||||
check_parse_html("π π<<pre><code>π π<</code></>", "π π<π π<",
|
check_parse_html("π π<<pre><code>π π<</code></>", "π π<π π<",
|
||||||
{{td::MessageEntity::Type::Pre, 6, 6}, {td::MessageEntity::Type::Code, 6, 6}});
|
{{td::MessageEntity::Type::Pre, 6, 6}, {td::MessageEntity::Type::Code, 6, 6}});
|
||||||
check_parse_html("π π<<pre><code class=\"language-\">π π<</code></>", "π π<π π<",
|
check_parse_html("π π<<pre><code class=\"language-\">π π<</code></>", "π π<π π<",
|
||||||
@ -1360,8 +1341,7 @@ TEST(MessageEntities, parse_html) {
|
|||||||
{{td::MessageEntity::Type::Pre, 6, 7}, {td::MessageEntity::Type::Code, 6, 6}});
|
{{td::MessageEntity::Type::Pre, 6, 7}, {td::MessageEntity::Type::Code, 6, 6}});
|
||||||
check_parse_html("π π<<pre> <code class=\"language-fift\">π π<</></>", "π π< π π<",
|
check_parse_html("π π<<pre> <code class=\"language-fift\">π π<</></>", "π π< π π<",
|
||||||
{{td::MessageEntity::Type::Pre, 6, 7}, {td::MessageEntity::Type::Code, 7, 6}});
|
{{td::MessageEntity::Type::Pre, 6, 7}, {td::MessageEntity::Type::Code, 7, 6}});
|
||||||
check_parse_html("β‘οΈ β‘οΈ<tg-emoji emoji-id = \"12345\">β‘οΈ β‘οΈ</tg-emoji><b>β‘οΈ β‘οΈ</b>",
|
check_parse_html("β‘οΈ β‘οΈ<tg-emoji emoji-id = \"12345\">β‘οΈ β‘οΈ</tg-emoji><b>β‘οΈ β‘οΈ</b>", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
||||||
"β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
|
||||||
{{td::MessageEntity::Type::CustomEmoji, 5, 5, td::CustomEmojiId(static_cast<td::int64>(12345))},
|
{{td::MessageEntity::Type::CustomEmoji, 5, 5, td::CustomEmojiId(static_cast<td::int64>(12345))},
|
||||||
{td::MessageEntity::Type::Bold, 10, 5}});
|
{td::MessageEntity::Type::Bold, 10, 5}});
|
||||||
check_parse_html("π π<tg-emoji emoji-id=\"54321\">π <π</tg-emoji>", "π ππ <π",
|
check_parse_html("π π<tg-emoji emoji-id=\"54321\">π <π</tg-emoji>", "π ππ <π",
|
||||||
@ -1444,8 +1424,7 @@ TEST(MessageEntities, parse_markdown) {
|
|||||||
check_parse_markdown("π π_abac \\* asd _", "π πabac * asd ", {{td::MessageEntity::Type::Italic, 5, 11}});
|
check_parse_markdown("π π_abac \\* asd _", "π πabac * asd ", {{td::MessageEntity::Type::Italic, 5, 11}});
|
||||||
check_parse_markdown("π \\.π_π\\. π_", "π .ππ. π", {{td::MessageEntity::Type::Italic, 6, 6}});
|
check_parse_markdown("π \\.π_π\\. π_", "π .ππ. π", {{td::MessageEntity::Type::Italic, 6, 6}});
|
||||||
check_parse_markdown("\\\\\\a\\b\\c\\d\\e\\f\\1\\2\\3\\4\\β‘οΈ\\", "\\abcdef1234\\β‘οΈ\\", {});
|
check_parse_markdown("\\\\\\a\\b\\c\\d\\e\\f\\1\\2\\3\\4\\β‘οΈ\\", "\\abcdef1234\\β‘οΈ\\", {});
|
||||||
check_parse_markdown("β‘οΈ β‘οΈ_β‘οΈ β‘οΈ_", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_markdown("β‘οΈ β‘οΈ_β‘οΈ β‘οΈ_", "β‘οΈ β‘οΈβ‘οΈ β‘οΈ", {{td::MessageEntity::Type::Italic, 5, 5}});
|
||||||
{{td::MessageEntity::Type::Italic, 5, 5}});
|
|
||||||
check_parse_markdown("β‘οΈ β‘οΈ_β‘οΈ β‘οΈ_*β‘οΈ β‘οΈ*", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
check_parse_markdown("β‘οΈ β‘οΈ_β‘οΈ β‘οΈ_*β‘οΈ β‘οΈ*", "β‘οΈ β‘οΈβ‘οΈ β‘οΈβ‘οΈ β‘οΈ",
|
||||||
{{td::MessageEntity::Type::Italic, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
{{td::MessageEntity::Type::Italic, 5, 5}, {td::MessageEntity::Type::Bold, 10, 5}});
|
||||||
check_parse_markdown("π π_π \\.π_", "π ππ .π", {{td::MessageEntity::Type::Italic, 5, 6}});
|
check_parse_markdown("π π_π \\.π_", "π ππ .π", {{td::MessageEntity::Type::Italic, 5, 6}});
|
||||||
@ -1458,22 +1437,14 @@ TEST(MessageEntities, parse_markdown) {
|
|||||||
check_parse_markdown("π π__π _π_\\___", "π ππ π_",
|
check_parse_markdown("π π__π _π_\\___", "π ππ π_",
|
||||||
{{td::MessageEntity::Type::Underline, 5, 6}, {td::MessageEntity::Type::Italic, 8, 2}});
|
{{td::MessageEntity::Type::Underline, 5, 6}, {td::MessageEntity::Type::Italic, 8, 2}});
|
||||||
check_parse_markdown("π π`π π```", "π ππ π", {{td::MessageEntity::Type::Code, 5, 5}});
|
check_parse_markdown("π π`π π```", "π ππ π", {{td::MessageEntity::Type::Code, 5, 5}});
|
||||||
check_parse_markdown("π π```π π```", "π π π",
|
check_parse_markdown("π π```π π```", "π π π", {{td::MessageEntity::Type::PreCode, 5, 3, "π"}});
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 3, "π"}});
|
check_parse_markdown("π π```π\nπ```", "π ππ", {{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
||||||
check_parse_markdown("π π```π\nπ```", "π ππ",
|
check_parse_markdown("π π```π\rπ```", "π ππ", {{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
check_parse_markdown("π π```π\n\rπ```", "π ππ", {{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
||||||
check_parse_markdown("π π```π\rπ```", "π ππ",
|
check_parse_markdown("π π```π\r\nπ```", "π ππ", {{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
check_parse_markdown("π π```π\n\nπ```", "π π\nπ", {{td::MessageEntity::Type::PreCode, 5, 3, "π"}});
|
||||||
check_parse_markdown("π π```π\n\rπ```", "π ππ",
|
check_parse_markdown("π π```π\r\rπ```", "π π\rπ", {{td::MessageEntity::Type::PreCode, 5, 3, "π"}});
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
check_parse_markdown("π π```π \\\\\\`π```", "π π \\`π", {{td::MessageEntity::Type::PreCode, 5, 5, "π"}});
|
||||||
check_parse_markdown("π π```π\r\nπ```", "π ππ",
|
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 2, "π"}});
|
|
||||||
check_parse_markdown("π π```π\n\nπ```", "π π\nπ",
|
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 3, "π"}});
|
|
||||||
check_parse_markdown("π π```π\r\rπ```", "π π\rπ",
|
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 3, "π"}});
|
|
||||||
check_parse_markdown("π π```π \\\\\\`π```", "π π \\`π",
|
|
||||||
{{td::MessageEntity::Type::PreCode, 5, 5, "π"}});
|
|
||||||
check_parse_markdown("π π**", "π π", {});
|
check_parse_markdown("π π**", "π π", {});
|
||||||
check_parse_markdown("||test||", "test", {{td::MessageEntity::Type::Spoiler, 0, 4}});
|
check_parse_markdown("||test||", "test", {{td::MessageEntity::Type::Spoiler, 0, 4}});
|
||||||
check_parse_markdown("π π``", "π π", {});
|
check_parse_markdown("π π``", "π π", {});
|
||||||
@ -1533,19 +1504,18 @@ TEST(MessageEntities, parse_markdown_v3) {
|
|||||||
check_parse_markdown_v3("π````π``π`abaπ```cπ`abaπ dabaπ```cπ`abaπ```π `π``π```",
|
check_parse_markdown_v3("π````π``π`abaπ```cπ`abaπ dabaπ```cπ`abaπ```π `π``π```",
|
||||||
"π````π``πabaπ```cπabaπ dabaπcπ`abaππ `π``π```",
|
"π````π``πabaπ```cπabaπ dabaπcπ`abaππ `π``π```",
|
||||||
{{td::MessageEntity::Type::Code, 12, 11}, {td::MessageEntity::Type::Pre, 35, 9}});
|
{{td::MessageEntity::Type::Code, 12, 11}, {td::MessageEntity::Type::Pre, 35, 9}});
|
||||||
check_parse_markdown_v3(
|
check_parse_markdown_v3("π````π``π`abaπ```cπ`abaπ dabaπ```cπ`abaππ```π `π``π```",
|
||||||
"π````π``π`abaπ```cπ`abaπ dabaπ```cπ`abaππ```π `π``π```",
|
{{td::MessageEntity::Type::Italic, 12, 1},
|
||||||
{{td::MessageEntity::Type::Italic, 12, 1},
|
{td::MessageEntity::Type::Italic, 44, 1},
|
||||||
{td::MessageEntity::Type::Italic, 44, 1},
|
{td::MessageEntity::Type::Bold, 45, 1},
|
||||||
{td::MessageEntity::Type::Bold, 45, 1},
|
{td::MessageEntity::Type::Bold, 49, 2}},
|
||||||
{td::MessageEntity::Type::Bold, 49, 2}},
|
"π````π``π`abaπcπ`abaπ dabaπcπ`abaπππ `π``π",
|
||||||
"π````π``π`abaπcπ`abaπ dabaπcπ`abaπππ `π``π",
|
{{td::MessageEntity::Type::Italic, 12, 1},
|
||||||
{{td::MessageEntity::Type::Italic, 12, 1},
|
{td::MessageEntity::Type::Pre, 18, 16},
|
||||||
{td::MessageEntity::Type::Pre, 18, 16},
|
{td::MessageEntity::Type::Italic, 38, 1},
|
||||||
{td::MessageEntity::Type::Italic, 38, 1},
|
{td::MessageEntity::Type::Bold, 39, 1},
|
||||||
{td::MessageEntity::Type::Bold, 39, 1},
|
{td::MessageEntity::Type::Bold, 43, 2},
|
||||||
{td::MessageEntity::Type::Bold, 43, 2},
|
{td::MessageEntity::Type::Pre, 45, 10}});
|
||||||
{td::MessageEntity::Type::Pre, 45, 10}});
|
|
||||||
check_parse_markdown_v3("` `", " ", {{td::MessageEntity::Type::Code, 0, 1}});
|
check_parse_markdown_v3("` `", " ", {{td::MessageEntity::Type::Code, 0, 1}});
|
||||||
check_parse_markdown_v3("`\n`", "\n", {{td::MessageEntity::Type::Code, 0, 1}});
|
check_parse_markdown_v3("`\n`", "\n", {{td::MessageEntity::Type::Code, 0, 1}});
|
||||||
check_parse_markdown_v3("` `a", " a", {{td::MessageEntity::Type::Code, 0, 1}}, true);
|
check_parse_markdown_v3("` `a", " a", {{td::MessageEntity::Type::Code, 0, 1}}, true);
|
||||||
|
Loadingβ¦
Reference in New Issue
Block a user