-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2120 from undb-io/release/v1.0.0-113
Release version v1.0.0-113
- Loading branch information
Showing
10 changed files
with
542 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { describe, expect, it } from "bun:test" | ||
import { FormulaRegistry } from "./formula.registry" | ||
|
||
describe("FormulaRegistry", () => { | ||
it("should register ADD functions", () => { | ||
const registry = new FormulaRegistry() | ||
registry.register("ADD", [["number", "number"]], "number") | ||
expect(registry.isValid("ADD")).toBe(true) | ||
expect(registry.get("ADD")?.syntax).toEqual(["ADD(number1, number2)"]) | ||
}) | ||
|
||
it("should register SUM functions", () => { | ||
const registry = new FormulaRegistry() | ||
registry.register("SUM", [["number", "variadic"]], "number") | ||
expect(registry.isValid("SUM")).toBe(true) | ||
expect(registry.get("SUM")?.syntax).toEqual(["SUM(number1, [number2, ...])"]) | ||
}) | ||
|
||
it("should register ABS functions", () => { | ||
const registry = new FormulaRegistry() | ||
registry.register("ABS", [["number"]], "number") | ||
expect(registry.isValid("ABS")).toBe(true) | ||
expect(registry.get("ABS")?.syntax).toEqual(["ABS(number)"]) | ||
}) | ||
}) |
Oops, something went wrong.