kdb - 如何在 qcumber 测试中使用与外键链接的 2 个本地表?
问题描述
我有以下测试代码
feature UsingQcumber
should be able to create 2 tables in a test
expect the code to run through to the end
tParent:([id: til 5]; parentData: 5 ? 100);
tChild:([] parentId: `tParent$ 20 ? 5; childData: 20 ? 1000);
1b
此测试因以下原因而失败
file test1.quke
feature UsingQcumber
(should) be able to create 2 tables in a test
- fail | (expect) the code to run through to the end
error: tParent (line 3)
如果我删除外键,则测试通过。所以我希望qcumber正在使用某种命名空间恶作剧。另外,如果我全局分配表,::
那么它就会通过。但是,如果我希望我的测试被隔离怎么办?
解决方案
据我所知,您不能将外键(或枚举符号)设置为本地表(或本地符号列表)......它必须是全局的。因此,您唯一的选择是全局创建 tParent 并在之后将其删除。
请注意,您的 tChild 表可以是本地的,而不是外键(或枚举)的目标
推荐阅读
- java - 参数化构造函数的工作方式与设置器不同吗?
- swift3 - 快速滚动时使用翠鸟冻结加载 url 图像
- pylint - pylint:如何禁用长导入语句的最大行长度限制
- node.js - 如何在 NodeJS 中获取 Promise 之外的 Promise 值
- html - 悬停时孩子的“添加填充”不会忽略父母的填充并且文本向下移动
- ruby - TypeError:没有将 false 隐式转换为 Hash
- python-3.x - Python 和 Soup HTTPS Web 抓取 - Open.SSL.Error
- c# - 在 asp.net mvc 中从数据库中检索数据时遇到问题
- php - $_POST'值只能使用一次?
- android - FireBase 同时连接