malwoden
Version:
   
24 lines • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var _1 = require(".");
var memory_terminal_1 = require("./memory-terminal");
describe("MemoryTerminal", function () {
it("will write glyphs to memory", function () {
var t = new memory_terminal_1.MemoryTerminal({ width: 10, height: 10 });
var g = new _1.Glyph(" ", _1.Color.Green, _1.Color.Blue);
t.drawGlyph({ x: 0, y: 0 }, g);
expect(t.glyphs.get({ x: 0, y: 0 })).toEqual(g);
expect(t.glyphs.get({ x: 1, y: 0 })).toEqual(undefined);
t.delete();
});
it("will not throw when writing glyphs out of bounds", function () {
var t = new memory_terminal_1.MemoryTerminal({ width: 10, height: 10 });
var g = new _1.Glyph(" ", _1.Color.Green, _1.Color.Blue);
t.drawGlyph({ x: -1, y: 0 }, g);
});
it("will return the same value for windowToTilePoint", function () {
var t = new memory_terminal_1.MemoryTerminal({ width: 10, height: 10 });
expect(t.windowToTilePoint({ x: 5, y: 10 })).toEqual({ x: 5, y: 10 });
});
});
//# sourceMappingURL=memory-terminal.spec.js.map