2024-05-01 15:55:52 -04:00
|
|
|
import { BasicTests } from "../../test/helper/Basic";
|
|
|
|
import { ConstantOutput } from "../../test/helper/ConstantOutput";
|
2019-07-24 23:16:58 -04:00
|
|
|
import { Negate } from "./Negate";
|
|
|
|
import { Signal } from "./Signal";
|
|
|
|
|
|
|
|
describe("Negate", () => {
|
|
|
|
|
|
|
|
BasicTests(Negate);
|
|
|
|
|
|
|
|
context("Negating", () => {
|
|
|
|
|
|
|
|
it("negateates a positive value", () => {
|
|
|
|
return ConstantOutput(() => {
|
|
|
|
const signal = new Signal(1);
|
|
|
|
const negate = new Negate();
|
|
|
|
signal.connect(negate);
|
2019-07-25 11:32:56 -04:00
|
|
|
negate.toDestination();
|
2019-07-24 23:16:58 -04:00
|
|
|
}, -1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("makes a negateative value positive", () => {
|
|
|
|
return ConstantOutput(() => {
|
|
|
|
const signal = new Signal(-10);
|
|
|
|
const negate = new Negate();
|
|
|
|
signal.connect(negate);
|
2019-07-25 11:32:56 -04:00
|
|
|
negate.toDestination();
|
2019-07-24 23:16:58 -04:00
|
|
|
}, 10);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|