generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: mankool0 <8884398+mankool0@users.noreply.github.com>
1 parent
2519178
commit c6dc790
Showing
9 changed files
with
114 additions
and
3,641 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,48 @@ | ||
import { ExtractInlineSolveStage } from "@/pipelines/stages/expression/ExtractInlineSolveState"; | ||
import { IExpressionProcessorState } from "@/pipelines/stages/expression/state/IExpressionProcessorState"; | ||
import { beforeAll, describe, expect, test } from "@jest/globals"; | ||
|
||
let state: IExpressionProcessorState; | ||
let stage: ExtractInlineSolveStage; | ||
|
||
beforeAll(() => { | ||
state = { | ||
lineNumber: 0, | ||
originalLineText: "", | ||
}; | ||
stage = new ExtractInlineSolveStage(); | ||
}); | ||
|
||
describe("Inline Solve", () => { | ||
test("Single Inline", () => { | ||
const request = "s`1 + 2`"; | ||
state.originalLineText = request; | ||
const result = stage.process(state, [request]); | ||
expect(result).toBeDefined(); | ||
expect(result).toEqual(["1 + 2"]); | ||
}); | ||
|
||
test("Multiple Inline", () => { | ||
const request = "s`1 + 2` & s`2 - 1`"; | ||
state.originalLineText = request; | ||
const result = stage.process(state, [request]); | ||
expect(result).toBeDefined(); | ||
expect(result).toEqual(["1 + 2", "2 - 1"]); | ||
}); | ||
|
||
test("Single Variable", () => { | ||
const request = "s`:var + 1`"; | ||
state.originalLineText = request; | ||
const result = stage.process(state, [request]); | ||
expect(result).toBeDefined(); | ||
expect(result).toEqual([":var + 1"]); | ||
}); | ||
|
||
test("Multiple Variables", () => { | ||
const request = "s`:var + 1` & s`:var2 - 1`"; | ||
state.originalLineText = request; | ||
const result = stage.process(state, [request]); | ||
expect(result).toBeDefined(); | ||
expect(result).toEqual([":var + 1", ":var2 - 1"]); | ||
}); | ||
}); |
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