Commits

Tuukka Norri committed c943a55

Unit tests
- Added a test table with Unicode astral characters in its name. It isn't currently used for anything.

Comments (0)

Files changed (1)

UnitTests/BaseTenTest.sql

 INSERT INTO person VALUES (1, 'nzhuk', 1, 1);
 
 
+-- Test a non-ASCII name.
 CREATE TABLE ♨ (id SERIAL PRIMARY KEY, value VARCHAR (255));
 SELECT baseten.enable (c.oid) FROM pg_class c, pg_namespace n
 	WHERE c.relnamespace = n.oid AND n.nspname = 'public' AND c.relname = '♨';
 INSERT INTO ♨ (value) VALUES ('test3');
 
 
+-- Test an astral character name.
+CREATE TABLE 𐄤𐄧𐄪𐄷 (id SERIAL PRIMARY KEY, value VARCHAR (255));
+SELECT baseten.enable (c.oid) FROM pg_class c, pg_namespace n
+	WHERE c.relnamespace = n.oid AND n.nspname = 'public' AND c.relname = '𐄤𐄧𐄪𐄷';
+
+GRANT SELECT, INSERT, UPDATE, DELETE ON 𐄤𐄧𐄪𐄷 TO baseten_test_user;
+GRANT USAGE ON SEQUENCE 𐄤𐄧𐄪𐄷_id_seq TO baseten_test_user;
+INSERT INTO 𐄤𐄧𐄪𐄷 (value) VALUES ('test1');
+INSERT INTO 𐄤𐄧𐄪𐄷 (value) VALUES ('test2');
+INSERT INTO 𐄤𐄧𐄪𐄷 (value) VALUES ('test3');
+
+
 CREATE TABLE datetest (
     id SERIAL PRIMARY KEY, 
     d1 date DEFAULT CURRENT_TIMESTAMP::date,