aboutsummaryrefslogtreecommitdiffgithub
path: root/novice/cli.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'novice/cli.test.ts')
-rw-r--r--novice/cli.test.ts27
1 files changed, 6 insertions, 21 deletions
diff --git a/novice/cli.test.ts b/novice/cli.test.ts
index 1955af8..abe7241 100644
--- a/novice/cli.test.ts
+++ b/novice/cli.test.ts
@@ -495,25 +495,20 @@ describe('cli', () => {
describe('dbg subcommand', () => {
let mockDbg: CliDebugger;
- // @ts-ignore
- let mockDbgSymbTable: SymbTable;
beforeAll(() => {
// @ts-ignore
mockDbg = {
loadSections: jest.fn(),
+ setSymbols: jest.fn(),
run: jest.fn(),
- getSymbTable: jest.fn(),
close: jest.fn(),
};
});
beforeEach(() => {
- mockDbgSymbTable = {bob: 0xbeef};
// @ts-ignore
CliDebugger.mockImplementation(() => mockDbg);
- // @ts-ignore
- mockDbg.getSymbTable.mockReturnValue(mockDbgSymbTable);
});
afterEach(() => {
@@ -522,9 +517,9 @@ describe('cli', () => {
// @ts-ignore
mockDbg.loadSections.mockReset();
// @ts-ignore
- mockDbg.run.mockReset();
+ mockDbg.setSymbols.mockReset();
// @ts-ignore
- mockDbg.getSymbTable.mockReset();
+ mockDbg.run.mockReset();
// @ts-ignore
mockDbg.close.mockReset();
});
@@ -553,15 +548,11 @@ describe('cli', () => {
// @ts-ignore
expect(CliDebugger.mock.calls).toEqual([[mockSimConfig.isa, stdin, stdout]]);
// @ts-ignore
- expect(mockDbg.getSymbTable.mock.calls).toEqual([[]]);
+ expect(mockDbg.setSymbols.mock.calls).toEqual([[mockSymbTable]]);
// @ts-ignore
expect(mockDbg.run.mock.calls).toEqual([[]]);
// @ts-ignore
expect(mockDbg.close.mock.calls).toEqual([[]]);
- expect(mockDbgSymbTable).toEqual({
- bob: 0xbeef,
- nice: 0x69,
- });
});
});
@@ -579,7 +570,7 @@ describe('cli', () => {
// @ts-ignore
expect(mockSimConfig.loader.load.mock.calls).toEqual([[mockSimConfig.isa, mockFp, mockDbg]]);
// @ts-ignore
- expect(mockSimConfig.loader.loadSymb.mock.calls).toEqual([[mockFp, mockDbgSymbTable]]);
+ expect(mockSimConfig.loader.loadSymb.mock.calls).toEqual([[mockFp, mockDbg]]);
// @ts-ignore
expect(getConfig.mock.calls).toEqual([]);
// @ts-ignore
@@ -589,8 +580,6 @@ describe('cli', () => {
// @ts-ignore
expect(CliDebugger.mock.calls).toEqual([[mockSimConfig.isa, stdin, stdout]]);
// @ts-ignore
- expect(mockDbg.getSymbTable.mock.calls).toEqual([[]]);
- // @ts-ignore
expect(mockDbg.run.mock.calls).toEqual([[]]);
// @ts-ignore
expect(mockDbg.close.mock.calls).toEqual([[]]);
@@ -633,8 +622,6 @@ describe('cli', () => {
// @ts-ignore
expect(CliDebugger.mock.calls).toEqual([[mockSimConfig.isa, stdin, stdout]]);
// @ts-ignore
- expect(mockDbg.getSymbTable.mock.calls).toEqual([]);
- // @ts-ignore
expect(mockDbg.run.mock.calls).toEqual([[]]);
// @ts-ignore
expect(mockDbg.close.mock.calls).toEqual([[]]);
@@ -686,7 +673,7 @@ describe('cli', () => {
// @ts-ignore
expect(mockSimConfig.loader.load.mock.calls).toEqual([[mockSimConfig.isa, mockFp, mockDbg]]);
// @ts-ignore
- expect(mockSimConfig.loader.loadSymb.mock.calls).toEqual([[mockFp, mockDbgSymbTable]]);
+ expect(mockSimConfig.loader.loadSymb.mock.calls).toEqual([[mockFp, mockDbg]]);
// @ts-ignore
expect(getConfig.mock.calls).toEqual([]);
// @ts-ignore
@@ -696,8 +683,6 @@ describe('cli', () => {
// @ts-ignore
expect(CliDebugger.mock.calls).toEqual([[mockSimConfig.isa, stdin, stdout]]);
// @ts-ignore
- expect(mockDbg.getSymbTable.mock.calls).toEqual([[]]);
- // @ts-ignore
expect(mockDbg.run.mock.calls).toEqual([[]]);
// @ts-ignore
expect(mockDbg.close.mock.calls).toEqual([[]]);