From 62c24b375626ad02e6697107f4c69011c38d9b79 Mon Sep 17 00:00:00 2001 From: Sergey Larin Date: Fri, 28 Jan 2022 13:10:48 +0300 Subject: [PATCH] Added test to check WideChar const to UTF8String const conversion --- tests/test/tutf8charconst.pp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test/tutf8charconst.pp diff --git a/tests/test/tutf8charconst.pp b/tests/test/tutf8charconst.pp new file mode 100644 index 0000000000..00e2a26aca --- /dev/null +++ b/tests/test/tutf8charconst.pp @@ -0,0 +1,23 @@ +program tutf8charconst; + +{$mode objfpc}{$H+} + +const + FULLWIDTH_RIGHT_PARENTHESIS: UTF8String = #$FF09; + +var + UFFFF: UTF8String; +begin + if not((Length(FULLWIDTH_RIGHT_PARENTHESIS) = 3) and + (Ord(FULLWIDTH_RIGHT_PARENTHESIS[1]) = $EF) and + (Ord(FULLWIDTH_RIGHT_PARENTHESIS[2]) = $BC) and + (Ord(FULLWIDTH_RIGHT_PARENTHESIS[3]) = $89)) then + Halt(1); + + UFFFF := #65535; + if not((Length(UFFFF) = 3) and + (Ord(UFFFF[1]) = $EF) and + (Ord(UFFFF[2]) = $BF) and + (Ord(UFFFF[3]) = $BF)) then + Halt(2); +end.