mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 09:28:19 +02:00
* Test for stringtoidentifier
This commit is contained in:
parent
aedb6dbacd
commit
14c4a6796b
@ -123,9 +123,27 @@ type
|
||||
Procedure TestUNICODERANGE;
|
||||
end;
|
||||
|
||||
{ TCSSTreeOtherTest }
|
||||
|
||||
TCSSTreeOtherTest = Class(TBaseCSSTreeTest)
|
||||
Published
|
||||
Procedure TestStringToIdentifier;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TCSSTreeOtherTest }
|
||||
|
||||
procedure TCSSTreeOtherTest.TestStringToIdentifier;
|
||||
begin
|
||||
AssertEquals('Normal','abc',StringToIdentifier('abc'));
|
||||
AssertEquals('dash','-abc',StringToIdentifier('-abc'));
|
||||
AssertEquals('dashdash','--abc',StringToIdentifier('--abc'));
|
||||
AssertEquals('Underscore','abc_d',StringToIdentifier('abc_d'));
|
||||
AssertEquals('Numerical','abc_1',StringToIdentifier('abc_1'));
|
||||
AssertEquals('Weird','abc\(1\)',StringToIdentifier('abc(1)'));
|
||||
end;
|
||||
|
||||
{ TCSSTreeVisitorTest }
|
||||
|
||||
procedure TCSSTreeVisitorTest.Setup;
|
||||
@ -787,6 +805,6 @@ begin
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTests([TCSSTreeTypeTest,TCSSTreeAsStringTest,TCSSTreeVisitorTest]);
|
||||
RegisterTests([TCSSTreeTypeTest,TCSSTreeAsStringTest,TCSSTreeVisitorTest,TCSSTreeOtherTest]);
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user