我是单元测试的新手。
我正在尝试对以下代码进行单元测试
{
"name": "error",
"length": 189,
"severity": "ERROR",
"code": "42601",
"internalPosition": "8",
"internalQuery": "SELECT *",
"where": "PL/pgSQL function insertintoinstancedlist() line 15 at RETURN",
"file": "parse_target.c",
"line": "1290",
"routine": "ExpandAllTables"
}
CREATE OR REPLACE FUNCTION
insertIntoInstancedList ()
RETURNS TRIGGER AS $BODY$
DECLARE
BEGIN
INSERT INTO
creator.instanced_lists
(
list_id,
account_id
)
VALUES
(
new._id,
new.account_id
);
RETURN
*;
END
$BODY$
language plpgsql;
CREATE TRIGGER trig_list_insertion
AFTER INSERT ON creator.lists
FOR EACH ROW
EXECUTE PROCEDURE insertIntoInstancedList();
如何对这种方法进行单元测试?