Tuukka Norri avatar 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, 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.