Skip to content
Tcl Source Code Artifact [fe334d2937]
Login

Artifact [fe334d2937]

Artifact fe334d29370e9b8d2226146460dc6b497cd638423d615328fd6dfead086a7540:


# See the file LICENSE for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

source [file join [file dirname [info script]] ucdUtils.tcl]

namespace eval unicode::test {
	namespace path ::tcltests::ucd

	test string-is-lower-ucd "string is lower vs UCD" -setup {
	 	set lowerChars [getLowercaseChars]
	 } -cleanup {
	    unset -nocomplain lowerChars
	 } -body {
		set mismatches {Lower case mismatches:}
		foreach codePoint [lseq 0 $::tcltests::ucd::maxCodepoint] {
			set ch [format %c $codePoint]
			if {[dict exists $lowerChars $ch] != [string is lower $ch]} {
				append mismatches " " U+[format %x $codePoint]
			}
		}
		set mismatches
	} -constraints ucdproperties -result {Lower case mismatches:}

	test string-is-upper-ucd "string is upper vs UCD" -setup {
	 	set upperChars [getUppercaseChars]
	 } -cleanup {
	    unset -nocomplain upperChars
	 } -body {
		set mismatches {Upper case mismatches:}
		foreach codePoint [lseq 0 $::tcltests::ucd::maxCodepoint] {
			set ch [format %c $codePoint]
			if {[dict exists $upperChars $ch] != [string is upper $ch]} {
				append mismatches " " U+[format %x $codePoint]
			}
		}
		set mismatches
	} -constraints ucdproperties -result {Upper case mismatches:}
}

::tcltest::cleanupTests
namespace delete unicode::test
return