File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 4747 " struct_tree_spec.js" ,
4848 " svg_factory_spec.js" ,
4949 " text_layer_spec.js" ,
50+ " to_unicode_map_spec.js" ,
5051 " type1_parser_spec.js" ,
5152 " ui_utils_spec.js" ,
5253 " unicode_spec.js" ,
Original file line number Diff line number Diff line change 1+ /* Copyright 2025 Mozilla Foundation
2+ *
3+ * Licensed under the Apache License, Version 2.0 (the "License");
4+ * you may not use this file except in compliance with the License.
5+ * You may obtain a copy of the License at
6+ *
7+ * http://www.apache.org/licenses/LICENSE-2.0
8+ *
9+ * Unless required by applicable law or agreed to in writing, software
10+ * distributed under the License is distributed on an "AS IS" BASIS,
11+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ * See the License for the specific language governing permissions and
13+ * limitations under the License.
14+ */
15+
16+ import { ToUnicodeMap } from "../../src/core/to_unicode_map.js" ;
17+
18+ describe ( "ToUnicodeMap" , ( ) => {
19+ it ( "should correctly map Extension B characters using codePointAt" , ( ) => {
20+ const cmap = { 0x20 : "\uD840\uDC00" } ; // Example Extension B character
21+ const toUnicodeMap = new ToUnicodeMap ( cmap ) ;
22+
23+ const expected = 0x20000 ; // Unicode code point for the character
24+ let actual ;
25+ toUnicodeMap . forEach ( ( charCode , unicode ) => {
26+ if ( charCode === ( 0x20 ) . toString ( ) ) {
27+ actual = unicode ;
28+ }
29+ } ) ;
30+
31+ expect ( actual ) . toBe ( expected ) ;
32+ } ) ;
33+ } ) ;
You can’t perform that action at this time.
0 commit comments