76 lines
4.2 KiB
EmacsLisp
76 lines
4.2 KiB
EmacsLisp
;; Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||
;; Released under Apache 2.0 license as described in the file LICENSE.
|
||
;;
|
||
;; Author: Soonho Kong
|
||
;;
|
||
|
||
(require 'ert)
|
||
(require 'dash)
|
||
(require 'lean-util)
|
||
|
||
(ert-deftest lean-test-isalpha ()
|
||
(--map (should (lean-isalpha it))
|
||
(list ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m
|
||
?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
|
||
?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M
|
||
?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z)))
|
||
|
||
(ert-deftest lean-test-isnum ()
|
||
(--map (should (lean-isnum it))
|
||
(list ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)))
|
||
|
||
(ert-deftest lean-test-isalnum ()
|
||
(--map (should (lean-isalnum it))
|
||
(list ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m
|
||
?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
|
||
?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M
|
||
?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z
|
||
?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)))
|
||
|
||
(ert-deftest lean-test-letter-like-unicode-p ()
|
||
(--map (should (lean-letter-like-unicode-p it))
|
||
(list ?α ?β ?γ ?δ ?ε ?ζ ?η ?θ ?ι ?κ ;;?λ
|
||
?μ ?ν ?ξ ?ο ?π ?ρ ?ς ?σ ?τ ?υ
|
||
?φ ?χ ?ψ ?ω))
|
||
(should (not (lean-letter-like-unicode-p ?λ)))
|
||
(--map (should (lean-letter-like-unicode-p it))
|
||
(list ?ϊ ?ϋ ?ό ?ύ ?ώ ?Ϗ ?ϐ ?ϑ ?ϒ ?ϓ ?ϔ ?ϕ ?ϖ
|
||
?ϗ ?Ϙ ?ϙ ?Ϛ ?ϛ ?Ϝ ?ϝ ?Ϟ ?ϟ ?Ϡ ?ϡ ?Ϣ ?ϣ
|
||
?Ϥ ?ϥ ?Ϧ ?ϧ ?Ϩ ?ϩ ?Ϫ ?ϫ ?Ϭ ?ϭ ?Ϯ ?ϯ ?ϰ
|
||
?ϱ ?ϲ ?ϳ ?ϴ ?ϵ ?϶ ?Ϸ ?ϸ ?Ϲ ?Ϻ ?ϻ))
|
||
(--map (should (lean-letter-like-unicode-p it))
|
||
(list ?ἀ ?ἁ ?ἂ ?ἃ ?ἄ ?ἅ ?ἆ ?ἇ ?Ἀ ?Ἁ ?Ἂ ?Ἃ ?Ἄ
|
||
?Ἅ ?Ἆ ?Ἇ ?ἐ ?ἑ ?ἒ ?ἓ ?ἔ ?ἕ ? ? ?Ἐ ?Ἑ
|
||
?Ἒ ?Ἓ ?Ἔ ?Ἕ ? ? ?ἠ ?ἡ ?ἢ ?ἣ ?ἤ ?ἥ
|
||
?ἦ ?ἧ ?Ἠ ?Ἡ ?Ἢ ?Ἣ ?Ἤ ?Ἥ ?Ἦ ?Ἧ ?ἰ ?ἱ
|
||
?ἲ ?ἳ ?ἴ ?ἵ ?ἶ ?ἷ ?Ἰ ?Ἱ ?Ἲ ?Ἳ ?Ἴ ?Ἵ ?Ἶ ?Ἷ
|
||
?ὀ ?ὁ ?ὂ ?ὃ ?ὄ ?ὅ ? ? ?Ὀ ?Ὁ ?Ὂ ?Ὃ
|
||
?Ὄ ?Ὅ ? ? ?ὐ ?ὑ ?ὒ ?ὓ ?ὔ ?ὕ ?ὖ ?ὗ
|
||
? ?Ὑ ? ?Ὓ ? ?Ὕ ? ?Ὗ ?ὠ ?ὡ ?ὢ
|
||
?ὣ ?ὤ ?ὥ ?ὦ ?ὧ ?Ὠ ?Ὡ ?Ὢ ?Ὣ ?Ὤ ?Ὥ ?Ὦ
|
||
?Ὧ ?ὰ ?ά ?ὲ ?έ ?ὴ ?ή ?ὶ ?ί ?ὸ ?ό ?ὺ ?ύ ?ὼ
|
||
?ώ ? ? ?ᾀ ?ᾁ ?ᾂ ?ᾃ ?ᾄ ?ᾅ ?ᾆ ?ᾇ ?ᾈ
|
||
?ᾉ ?ᾊ ?ᾋ ?ᾌ ?ᾍ ?ᾎ ?ᾏ ?ᾐ ?ᾑ ?ᾒ ?ᾓ ?ᾔ
|
||
?ᾕ ?ᾖ ?ᾗ ?ᾘ ?ᾙ ?ᾚ ?ᾛ ?ᾜ ?ᾝ ?ᾞ ?ᾟ ?ᾠ ?ᾡ ?ᾢ
|
||
?ᾣ ?ᾤ ?ᾥ ?ᾦ ?ᾧ ?ᾨ ?ᾩ ?ᾪ ?ᾫ ?ᾬ ?ᾭ ?ᾮ ?ᾯ ?ᾰ
|
||
?ᾱ ?ᾲ ?ᾳ ?ᾴ ? ?ᾶ ?ᾷ ?Ᾰ ?Ᾱ ?Ὰ ?Ά ?ᾼ ?᾽
|
||
?ι ?᾿ ?῀ ?῁ ?ῂ ?ῃ ?ῄ ? ?ῆ ?ῇ ?Ὲ ?Έ ?Ὴ
|
||
?Ή ?ῌ ?῍ ?῎ ?῏ ?ῐ ?ῑ ?ῒ ?ΐ ? ? ?ῖ ?ῗ
|
||
?Ῐ ?Ῑ ?Ὶ ?Ί ? ?῝ ?῞ ?῟ ?ῠ ?ῡ ?ῢ ?ΰ ?ῤ ?ῥ
|
||
?ῦ ?ῧ ?Ῠ ?Ῡ ?Ὺ ?Ύ ?Ῥ ?῭ ?΅ ?` ? ? ?ῲ ?ῳ
|
||
?ῴ ? ?ῶ ?ῷ ?Ὸ ?Ό ?Ὼ ?Ώ ?ῼ ?´ ?῾))
|
||
(--map (should (lean-letter-like-unicode-p it))
|
||
(list ?℀ ?℁ ?ℂ ?℃ ?℄ ?℅ ?℆ ?ℇ ?℈ ?℉ ?ℊ ?ℋ ?ℌ ?ℍ ?ℎ
|
||
?ℏ ?ℐ ?ℑ ?ℒ ?ℓ ?℔ ?ℕ ?№ ?℗ ?℘ ?ℙ ?ℚ ?ℛ ?ℜ ?ℝ
|
||
?℞ ?℟ ?℠ ?℡ ?™ ?℣ ?ℤ ?℥ ?Ω ?℧ ?ℨ ?℩ ?K ?Å ?ℬ
|
||
?ℭ ?℮ ?ℯ ?ℰ ?ℱ ?Ⅎ ?ℳ ?ℴ ?ℵ ?ℶ ?ℷ ?ℸ ?ℹ ?℺ ?℻
|
||
?ℼ ?ℽ ?ℾ ?ℿ ?⅀ ?⅁ ?⅂ ?⅃ ?⅄ ?ⅅ ?ⅆ ?ⅇ ?ⅈ ?ⅉ ?⅊
|
||
?⅋ ?⅌ ?⅍ ?ⅎ ?⅏)))
|
||
|
||
(ert-deftest lean-test-super-sub-script-alnum-unicode-p ()
|
||
(--map (should (lean-super-sub-script-alnum-unicode-p it))
|
||
(list ?ₐ ?ₑ ?ₒ ?ₓ ?ₔ ?ₕ ?ₖ ?ₗ ?ₘ ?ₙ ?ₚ ?ₛ ?ₜ))
|
||
(--map (should (lean-super-sub-script-alnum-unicode-p it))
|
||
(list ?ⁿ ?₀ ?₁ ?₂ ?₃ ?₄ ?₅ ?₆ ?₇ ?₈ ?₉))
|
||
(--map (should (lean-super-sub-script-alnum-unicode-p it))
|
||
(list ?⁰ ?ⁱ ? ? ?⁴ ?⁵ ?⁶ ?⁷ ?⁸)))
|