mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-02 04:48:06 +00:00
playground: Add AST/Tokens/Formatter panels (#5859)
This commit is contained in:
parent
9ed7ceeb0a
commit
46a17d11f3
19 changed files with 1343 additions and 780 deletions
|
|
@ -4,12 +4,12 @@ use wasm_bindgen_test::wasm_bindgen_test;
|
|||
|
||||
use ruff::registry::Rule;
|
||||
use ruff_python_ast::source_code::{OneIndexed, SourceLocation};
|
||||
use ruff_wasm::{check, ExpandedMessage};
|
||||
use ruff_wasm::{ExpandedMessage, Workspace};
|
||||
|
||||
macro_rules! check {
|
||||
($source:expr, $config:expr, $expected:expr) => {{
|
||||
let foo = js_sys::JSON::parse($config).unwrap();
|
||||
match check($source, foo) {
|
||||
let config = js_sys::JSON::parse($config).unwrap();
|
||||
match Workspace::new(config).unwrap().check($source) {
|
||||
Ok(output) => {
|
||||
let result: Vec<ExpandedMessage> = serde_wasm_bindgen::from_value(output).unwrap();
|
||||
assert_eq!(result, $expected);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue