Conversation
public/index.html
Outdated
| @@ -0,0 +1,43 @@ | |||
| <!DOCTYPE html> | |||
There was a problem hiding this comment.
как то это подозрительно смахивает на CREATE REACT APP
There was a problem hiding this comment.
и зачем весь этот код в public ?
src/lesson2/engine.test.ts
Outdated
| @@ -0,0 +1,25 @@ | |||
| import { firstPrioritiesCalc, secondPrioritiesCalc } from "./engine"; | |||
|
|
|||
| test("firstPrioritiesCalc: [1, * 32]", () => { | |||
There was a problem hiding this comment.
There was a problem hiding this comment.
// import { firstPrioritiesCalc, secondPrioritiesCalc } from "./engine";
// const table = [
// [1, "*", 32, 32],
// [32, "/", 32, 1],
// [32, "+", 32, 64],
// [32, "**", 0, 1024],
// [32, "^", 2, 1024],
// [6, "!", 0, 720],
// ];
// test.each(table)(
// "firstPrioritiesCalc(%s, %s, %s)",
// (a, operator, b, result) => {
// expect(firstPrioritiesCalc([a, operator, b])).toEqual(result);
// }
// );
// test.each(table)(
// "secondPrioritiesCalc(%s, %s, %s)",
// (a, operator, b, result) => {
// expect(secondPrioritiesCalc([a, operator, b])).toEqual(result);
// }
// );
| first: number, | ||
| second: number |
There was a problem hiding this comment.
вот эти типы уже заложены в ScalarOperationType так что тут просто дублирование кода
| // }); | ||
|
|
||
| // test("secondPrioritiesCalc: [32, x 32]", () => { | ||
| // expect(secondPrioritiesCalc([32, "x", 32])).toEqual(0); |
| // expect(firstPrioritiesCalc([32, "/", 32])).toEqual([1]); | ||
| // }); | ||
|
|
||
| // // test("firstPrioritiesCalc: [32, + 32]", () => { |
There was a problem hiding this comment.
а чем идея в возвращении массива?
secondPrioritiesCalc возвращает число
делал как мог друзья :)