mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
base: Remove ucd
dependency (#32424)
Remove the `ucd` dependency which has not been updated in 8 years. In addition, replace it with a generated UnicodeBlock enum which reflects the modern Unicode standard. This is generated via a Python script which is included in the repository. The generation is not part of the build process, because the Unicode database is hosted on the web and it does not change the frequently. This is done instead of bringing in the more up-to-date `unicode_blocks` dependency. `unicode_blocks` defines each block as constant, which means that they cannot be used in match statements -- which we do in Servo. Co-authored-by: Lauryn Menard <lauryn.menard@gmail.com>
This commit is contained in:
parent
48ab8d8847
commit
f8985c5521
18 changed files with 834 additions and 100 deletions
|
@ -1,24 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use gfx::text::util::is_cjk;
|
||||
|
||||
#[test]
|
||||
fn test_is_cjk() {
|
||||
// Test characters from different CJK blocks
|
||||
assert_eq!(is_cjk('〇'), true);
|
||||
assert_eq!(is_cjk('㐀'), true);
|
||||
assert_eq!(is_cjk('あ'), true);
|
||||
assert_eq!(is_cjk('ア'), true);
|
||||
assert_eq!(is_cjk('㆒'), true);
|
||||
assert_eq!(is_cjk('ㆣ'), true);
|
||||
assert_eq!(is_cjk('龥'), true);
|
||||
assert_eq!(is_cjk('𰾑'), true);
|
||||
assert_eq!(is_cjk('𰻝'), true);
|
||||
|
||||
// Test characters from outside CJK blocks
|
||||
assert_eq!(is_cjk('a'), false);
|
||||
assert_eq!(is_cjk('🙂'), false);
|
||||
assert_eq!(is_cjk('©'), false);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue