mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 20:09:20 +02:00
* Test for stringtoidentifier
This commit is contained in:
parent
aedb6dbacd
commit
14c4a6796b
@ -123,9 +123,27 @@ type
|
|||||||
Procedure TestUNICODERANGE;
|
Procedure TestUNICODERANGE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TCSSTreeOtherTest }
|
||||||
|
|
||||||
|
TCSSTreeOtherTest = Class(TBaseCSSTreeTest)
|
||||||
|
Published
|
||||||
|
Procedure TestStringToIdentifier;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
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 }
|
{ TCSSTreeVisitorTest }
|
||||||
|
|
||||||
procedure TCSSTreeVisitorTest.Setup;
|
procedure TCSSTreeVisitorTest.Setup;
|
||||||
@ -787,6 +805,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterTests([TCSSTreeTypeTest,TCSSTreeAsStringTest,TCSSTreeVisitorTest]);
|
RegisterTests([TCSSTreeTypeTest,TCSSTreeAsStringTest,TCSSTreeVisitorTest,TCSSTreeOtherTest]);
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user