tests/helper


Log

Author Commit Date CI Message
Michael Schmidt 8bfcc819 2020-11-21T01:17:39 Tests: Better pretty print (#2600) This is a major improvement for the pretty-printer. The main change is that `TokenStreamTransformer.prettyprint` now takes a Prism token stream instead of a simplified token stream. This means that it has a lot more information to work with and it uses that information. It mostly behaves like the old pretty-printer with 3 main differences: 1. Tokens that contain a nested token stream that only contains a single string are printed as one line. Example: `["namespace", ["java"]]` 2. The pretty-printer can now glue tokens together so that they are printed in a single line. Example: `["number", "100"], ["operator", ".."], ["number", "100"]` 3. Line breaks in the input code may now cause empty lines in the output. Previously, only blank strings containing more at least 2 line breaks produce empty lines. This helps readability as it groups tokens together.
Michael Schmidt bafab634 2020-08-17T16:22:21 Tests: Added an option to accept the actual token stream (#2515)
Michael Schmidt 681adeef 2020-06-28T03:16:17 Add extra newlines in pretty token streams (#2070) The formatter for the simplified token streams of our test cases will now emit extra (empty) newlines if the tested code also has an empty line at those positions.
Michael Schmidt 583e7eb5 2020-06-28T01:39:28 Tests: Always pretty-print token streams (#2421)
Michael Schmidt 4ff555be 2020-06-28T01:34:29 Added JSDoc (#1782)
Michael Schmidt e756be3f 2020-06-27T21:43:24 Tests are now faster (#2165)
Michael Schmidt e416341f 2020-05-22T17:37:53 Test: Always use `components.json` (#2370) All test files now consistently import `components.json` instead of `components.js`. The JS file is generated and can be outdated. This can be annoying when you're adding a language.
Michael Schmidt b4ed5ded 2020-05-19T01:47:03 Tests: Included console in VM context (#2353)
Michael Schmidt 7a4a0c7c 2019-12-16T12:49:21 Standardized dependency logic implementation (#1998) This adds a standard logic for handling dependencies between Prism components. Right now, the download page, the `loadLanguages` function, and the test suite use the new dependency system.
Michael Schmidt c187e229 2019-10-16T12:06:22 Added test for unused capturing groups (#1996) This adds a test that checks for unused capturing groups in patterns and another test which ensures that lookbehind groups are always the first thing being matched in a pattern.
Simran 007c9af4 2019-09-18T18:32:47 Tests: Simplified error message format (#2056) The error messages will now only contain the actual token stream the failed test and a full path of the test file plus the line and column number of the position of the first difference between the expected token stream and the actual token stream.
Michael Schmidt e864d518 2019-08-29T23:24:17 Core: Fixed greedy targeting bug (#1932) The `target` parameter defines the token which causes rematching. Rematching is done by recursively calling `matchGrammar` where `target` will be the current token name. The rematching is done if either a match was found or we reached the target token, whatever comes first. The bug is that a token is identified by its name. But the name alone doesn't uniquely identify a token in a grammar because many tokens can have the same name (array). This fixes this bug.
Michael Schmidt c3e74ea3 2019-03-24T22:50:22 Tests: Additional checks for Prism functions (#1803) This adds additional checks for `extend` and `insertBefore` under `Prism.languages`.
Michael Schmidt 832a9643 2019-03-10T21:30:58 Refactored tests (#1795) This refactors all test related JS files.
Michael Schmidt 9ea6d600 2019-03-10T18:55:23 Tests: Pretty-printed token stream (#1801) This adds support for pretty-printed token streams in the output of error messages.
Golmote 46e6f0c0 2018-04-05T08:51:43 Test suite: Fix indentation in test-case.js
Golmote 5f9c078a 2018-03-25T13:46:42 Make ERB, Handlebars, PHP and Smarty highlight properly in NodeJS (#1367)
Golmote 0e1a8b75 2018-03-20T08:54:48 Tests: Use the new components.js file directly
Golmote 2b8321d3 2018-03-20T08:37:58 JSX: Add support for plain text inside tags (#1357) * JSX: Add support for plain text inside tags * JSX: Use a "plain-text" token to identify plain text * TSX: Add support for plain text * Fix test after merge
Andreas Rohner 0a00d7f7 2017-02-10T17:10:19 Fix the PHP language This patch is an attempt to fix the PHP language, when it is combined with markup. The problem is, that markup has a higher priority than all other tokens. This leads to weird errors, where HTML tags are highlighted inside of comments #197. One solution to this was to set the `greedy` flag for the comment token, but this leads to far worse errors like #1097. This patch should fix both issues #197 and #1097, by switching the grammar to markup on the fly. One potential problem is, that it relies on the `<?php` tag to detect if markup is present. So if a PHP file contains only markup and no PHP code at all, the result will look broken.
thesave dfc19413 2016-11-09T01:57:46 Add support for the Jolie language (#1014) * Added component for the Jolie language * Added Jolie among the supported components * update for merge - revised jolie component - added tests - added code example - minified with `gulp` * fixes * fixes * fixed Jolie html file example and highlight for punctuation * fixed indentation in test html file and added comma as punctuation
Golmote c1a0c1bd 2016-07-11T20:37:47 Added TestCase.runTestsWithHooks + add missing tests. Updated documentation for test suite.
Golmote 5ade8a58 2015-10-06T08:25:54 Test runner: Allow to run tests for only some languages
Golmote a896f0a6 2015-08-30T16:06:37 Drastically increased the number of dashes (from 4 to 10) required for separations in test files, to prevent conflicts with languages syntax.
Golmote 791dad0d 2015-08-27T20:57:37 Tests: Increase the minimum number of dashes for the separation + fix test-suite page to match the actual behaviour.
Golmote ac792bd7 2015-08-25T08:04:33 Prism loader must handle dependency array.
Golmote d1b2e206 2015-08-19T00:19:45 Fix test runner: it must use the last language by default
Jannik Zschiesche 2bc55185 2015-07-26T14:34:41 Improve support of node 10.x
Jannik Zschiesche a13c87b9 2015-07-26T14:27:38 Added support for specifying the main language to load in test cases You can add an exclamation mark anywhere in the name to load it as main language. If you do not specify anything, the first entry is used as main language css+markup! --> markup is main language css+markup --> css is main language
Jannik Zschiesche 1e0b8d9d 2015-07-26T14:08:47 Fixed code style issues
Jannik Zschiesche f05e0797 2015-07-15T20:01:39 Updated simplification of token stream It now strips empty values
Jannik Zschiesche 3a3cd268 2015-07-15T19:35:07 Extract simplification of token stream Pull the token stream transformation out of the test case into its own component.
Jannik Zschiesche 5c2f9e0a 2015-07-15T19:29:27 Use consistent quote style
Jannik Zschiesche 9ce5838a 2015-07-14T10:51:35 Catch JSON parse error to provide a unified error reporting in the test runner
Jannik Zschiesche 9619d4cb 2015-07-14T10:46:57 Implement support for simplifying nested token streams
Jannik Zschiesche aec5fcc4 2015-06-13T16:41:31 Added return type definition
Jannik Zschiesche 09898e8e 2015-06-13T16:37:07 Support language inclusion tests By using composed language names "language+language2+language3" you can test language inclusion or do integration tests.
Jannik Zschiesche 829f8a86 2015-06-13T15:24:53 New file extension for test case files: .test ## All test case files are now required to have the ".test" extension. This prevents issues with syntax highlighting in common IDEs and also prevents the test system to choke on non-testcase files in these directories (like `.DS_Store` or `Thumbs.db`). ## Hide the ".test" extension in the description of the test cases The message for a testcase `blabla.test` will now just read: > 1) Testing language 'css' – should pass test case 'blabla':
Jannik Zschiesche be5e037b 2015-06-13T15:12:21 Added support for test case comments
Jannik Zschiesche d1f90520 2015-06-01T20:39:11 Implemented test runner