-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Tests for examples in embedded docs #3413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+143
−6
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
60725f3
test: add examples execution tests for embedded documentation
dvd101x a8353e8
Remmoved unnecesary try-catch block
dvd101x 3780ef8
Included more tests
dvd101x 0ae56c2
Added docs for compile, parse and parser
dvd101x c48f235
Added test for "see also" in embedded docs
dvd101x 7bbd852
Merge branch 'develop' into Errors-in-embedded-docs
dvd101x aab9b1e
Use Set instead of Array
dvd101x 08c2f13
Remove redundancy in documentation for parser
dvd101x 303c7ca
Extended comment for skipDocs
dvd101x a7682b0
Extended documentation for `parse`
dvd101x f3591fa
Merge branch 'develop' into Errors-in-embedded-docs
dvd101x a93914a
Separated logic for undocumented and with failing examples
dvd101x c527451
Renamed variable
dvd101x 567848e
Removing the use of `Set.difference`
dvd101x fa04bd5
Use sets instead of arrays
dvd101x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
16 changes: 16 additions & 0 deletions
16
src/expression/embeddedDocs/function/expression/compile.js
This file contains hidden or 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,16 @@ | ||
| export const compileDocs = { | ||
| name: 'compile', | ||
| category: 'Expression', | ||
| syntax: [ | ||
| 'compile(expr) ', | ||
| 'compile([expr1, expr2, expr3, ...])' | ||
| ], | ||
| description: 'Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.', | ||
| examples: [ | ||
| 'code1 = compile("sqrt(3^2 + 4^2)")', | ||
| 'code1.evaluate() ', | ||
| 'code2 = compile("a * b")', | ||
| 'code2.evaluate({a: 3, b: 4})' | ||
| ], | ||
| seealso: ['parser', 'parse', 'evaluate'] | ||
| } |
This file contains hidden or 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 hidden or 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,16 @@ | ||
| export const parseDocs = { | ||
| name: 'parse', | ||
| category: 'Expression', | ||
| syntax: [ | ||
| 'node1 = parse(expression)', | ||
| 'node1.compile().evaluate()' | ||
| ], | ||
| description: 'Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate().', | ||
gwhitney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| examples: [ | ||
| 'node1 = parse("sqrt(3^2 + 4^2)")', | ||
| 'node1.compile().evaluate()', | ||
| 'node2 = parse("a * b")', | ||
| 'node2.compile().evaluate({a:3, b:4})' | ||
| ], | ||
| seealso: ['parser', 'evaluate', 'compile'] | ||
| } | ||
This file contains hidden or 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,20 @@ | ||
| export const parserDocs = { | ||
| name: 'parser', | ||
| category: 'Expression', | ||
| syntax: [ | ||
| 'myParser = parser()', | ||
| 'myParser.set(name, value)', | ||
| 'myParser.get(name)', | ||
| 'myParser.evaluate(expression)', | ||
| 'myParser.evaluate([expr1, expr2, expr3, ...])' | ||
| ], | ||
| description: 'Create a parser. The function creates a new math.Parser object.', | ||
gwhitney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| examples: [ | ||
| 'myParser = parser()', | ||
| 'myParser.evaluate("sqrt(3^2 + 4^2)")', | ||
| 'myParser.set("x", 3)', | ||
| 'myParser.evaluate("y = x + 3")', | ||
| 'myParser.get("y")' | ||
| ], | ||
| seealso: ['evaluate', 'parse', 'compile'] | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -19,7 +19,6 @@ export const sumDocs = { | |
| 'min', | ||
| 'prod', | ||
| 'std', | ||
| 'sum', | ||
| 'variance' | ||
| ] | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.