我想制作一个程序,该程序需要用户输入10个字符并将其保存在矢量DATA中,但出现错误
无法添加相对数量
在mov byte ptr DATA[pos], al当我尝试保存的价值。
如何解决这个错误?
.model small
.stack 100h
.data
DATA db 10 dup(?)
cont db 010h
pos db 0h
msg db 10,13,7, 'Input: ', '$'
.code
mov ax, @data
mov ds, ax
mov es, ax
mov ah, 09h
lea dx, msg
int 21h
cicle:
mov ah, 01h
int 21h
mov byte ptr DATA[pos], al ;Save ASCII char in position pos in DATA
inc pos
dec cont
jnz cicle
Run Code Online (Sandbox Code Playgroud) 我正在尝试通过使用迁移功能来实现数据库填充。代码运行完美,它将所有数据保存到数据库中,但是功能测试失败,现在我想知道为什么?
对于此特定测试,我收到“超出 5000 毫秒超时”错误。我已经为这个应用程序编写了 166 个测试,所有测试都通过了。
这是我要测试的功能:
const doMigration = async ({ model, data }) => {
await model.collection.insertMany(data)
}
Run Code Online (Sandbox Code Playgroud)
这是测试:
const { Amodel } = require('../../../models/Amodel')
const { doMigration } = require('../../../database/migrations')
describe('Database Population', () => {
it ('Should populate the database using migrations', async () => {
const data = [{ name: 'A' }, { name: 'B' }]
const model = Amodel
const migration = { name: 'Amodel', model, data }
await doMigration(migration)
const countAfter = await Amodel.count() …Run Code Online (Sandbox Code Playgroud)