ruff/crates/red_knot_wasm/tests/api.rs
Charlie Marsh c3b40da0d2
Use backticks for code in red-knot messages (#13599)
## Summary

...and remove periods from messages that don't span more than a single
sentence.

This is more consistent with how we present user-facing messages in uv
(which has a defined style guide).
2024-10-02 03:14:28 +00:00

24 lines
614 B
Rust

#![cfg(target_arch = "wasm32")]
use wasm_bindgen_test::wasm_bindgen_test;
use red_knot_wasm::{Settings, TargetVersion, Workspace};
#[wasm_bindgen_test]
fn check() {
let settings = Settings {
target_version: TargetVersion::Py312,
};
let mut workspace = Workspace::new("/", &settings).expect("Workspace to be created");
workspace
.open_file("test.py", "import random22\n")
.expect("File to be opened");
let result = workspace.check().expect("Check to succeed");
assert_eq!(
result,
vec!["/test.py:1:8: Cannot resolve import `random22`"]
);
}