From 420b6d94694a13a6c83b36539fb4e7847ace4616 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Fri, 18 Mar 2022 16:04:19 -0500 Subject: [PATCH] update test case --- tests/TestDelete.m | 11 ++++++----- tests/test_schemas/+TestLab/Duty.m | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/TestDelete.m b/tests/TestDelete.m index 66fb93eb..34b3af93 100644 --- a/tests/TestDelete.m +++ b/tests/TestDelete.m @@ -46,20 +46,21 @@ function TestDelete_testTwoFKOnePK(testCase) dj.createSchema(package,[testCase.test_root '/test_schemas'], ... [testCase.PREFIX '_testlab']); - users = [{'user0'; 'user1'; 'user2'}]; + users = [{'user0'; 'user1'; 'user2'; 'user3'}]; insert(TestLab.User, users); - duty = [{'2020-01-01','user0','user1'}, - {'2020-01-02','user1','user2'}, - {'2020-12-31','user0','user2'}]; + duty = [{'2020-01-01','user0','user2', 'user1'}, + {'2020-01-02','user0','user1', 'user2'}, + {'2020-12-30','user1','user2', 'user0'}, + {'2020-12-31','user0','user2', 'user3'}]; insert(TestLab.Duty, duty); key.user_id = 'user1'; del(TestLab.User & key); - testCase.verifyEqual(length(fetch(TestLab.User)), 2); + testCase.verifyEqual(length(fetch(TestLab.User)), 3); testCase.verifyEqual(length(fetch(TestLab.Duty)), 1); testCase.verifyEqual(length(fetch(TestLab.User & 'user_id = "user1"')), 0); testCase.verifyEqual(length(fetch(TestLab.Duty & 'duty_first = "user1" OR duty_second = "user1"')), 0); diff --git a/tests/test_schemas/+TestLab/Duty.m b/tests/test_schemas/+TestLab/Duty.m index bbfa0fba..f993f4ff 100644 --- a/tests/test_schemas/+TestLab/Duty.m +++ b/tests/test_schemas/+TestLab/Duty.m @@ -3,6 +3,7 @@ ----- (duty_first) -> TestLab.User(user_id) (duty_second) -> TestLab.User(user_id) +(duty_third) -> TestLab.User(user_id) %} classdef Duty < dj.Manual