>From b4de3e816d7396d60a6ac330a7aed4bc7a90d888 Mon Sep 17 00:00:00 2001
From: Vladimir Sedach <vas@oneofus.la>
Date: Sun, 3 May 2020 17:46:59 -0700
Subject: [PATCH 1/2] tests: Add Unicode tests for two problems in internal
 case handling

---
 src/tests/ecl-tests.asd            |  1 +
 src/tests/ecl-tests.lisp           |  2 +-
 src/tests/normal-tests/unicode.lsp | 42 ++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 src/tests/normal-tests/unicode.lsp

diff --git a/src/tests/ecl-tests.asd b/src/tests/ecl-tests.asd
index fa5ec763..a82c9992 100644
--- a/src/tests/ecl-tests.asd
+++ b/src/tests/ecl-tests.asd
@@ -25,6 +25,7 @@
                          (:file "package-extensions")
 			 (:file "hash-tables")
                          (:file "external-formats" :if-feature :unicode)
+                         (:file "unicode" :if-feature :unicode)
                          (:file "complex")))
                (:module stress-tests
                         :default-component-class asdf:cl-source-file.lsp
diff --git a/src/tests/ecl-tests.lisp b/src/tests/ecl-tests.lisp
index 66594b46..55656e43 100644
--- a/src/tests/ecl-tests.lisp
+++ b/src/tests/ecl-tests.lisp
@@ -22,7 +22,7 @@
 ;;;; Declare the suites
 (suite 'make-check
        '(executable ieee-fp eprocess package-ext hash-tables ansi+ mixed
-         cmp emb ffi mop run-program mp complex))
+         cmp emb ffi mop run-program mp complex #+unicode unicode))
 
 (suite 'ecl-tests
        '(make-check eformat))
diff --git a/src/tests/normal-tests/unicode.lsp b/src/tests/normal-tests/unicode.lsp
new file mode 100644
index 00000000..a3297679
--- /dev/null
+++ b/src/tests/normal-tests/unicode.lsp
@@ -0,0 +1,42 @@
+;;;; -*- encoding:utf-8; Mode: Lisp; Syntax: Common-Lisp; indent-tabs-mode: nil -*-
+;;;; vim: set filetype=lisp tabstop=8 shiftwidth=2 expandtab:
+
+;;;; Author:   Vladimir Sedach <vas@oneofus.la>
+;;;; Created:  2020-05-03
+;;;; Contains: Unicode handling in the compiler and runtime
+
+(in-package :cl-test)
+
+(suite 'unicode)
+
+;;; Date: 2020-05-03
+;;; From: Vladimir Sedach <vas@oneofus.la>
+;;; Fixed: 2020-05-03 (Vladimir Sedach)
+;;; Description:
+;;;
+;;;     Compiler does not handle non-ASCII symbols correctly when
+;;;     READTABLE-CASE is :INVERT
+;;;
+(test unicode.0001.compiler-unicode-inverted-case
+  (let ((test-readtable (copy-readtable)))
+    (dolist (case '(:invert :upcase :downcase :preserve))
+      (setf (readtable-case test-readtable) case)
+      (let ((*readtable* test-readtable))
+        (is (= 3
+               (funcall
+                (compile nil
+                         (cons 'lambda
+                               (read-from-string "((𝛅 𝛜) (+ 𝛅 𝛜))")))
+                1 2)))))))
+
+;;; Date: 2020-05-03
+;;; From: Vladimir Sedach <vas@oneofus.la>
+;;; Fixed: 2020-05-03 (Vladimir Sedach)
+;;; Description:
+;;;
+;;;     Pathname :common case conversion fails on Unicode pathnames
+;;;
+(test unicode.0002.pathname-common-unicode
+  (is (equal
+       "ДАННЫЕ"
+       (pathname-name (pathname "/tmp/данные.txt") :case :common))))
-- 
2.20.1

