Skip to content

Commit

Permalink
use web backend for web tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Dec 21, 2023
1 parent d5d0d28 commit 37f66ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion site/src/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub const EXAMPLES: &[&str] = &[
#[test]
fn test_examples() {
for example in EXAMPLES {
match uiua::Uiua::with_native_sys().run_str(example) {
match uiua::Uiua::with_backend(crate::backend::WebBackend::default()).run_str(example) {
Ok(mut comp) => {
if let Some(diag) = comp.take_diagnostics().into_iter().next() {
panic!("Example failed:\n{example}\n{diag}");
Expand Down
6 changes: 5 additions & 1 deletion site/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,11 @@ fn site() {
path.to_path_buf(),
code.clone(),
std::thread::spawn(move || {
(uiua::Uiua::with_native_sys().run_str(&code), should_fail)
(
uiua::Uiua::with_backend(crate::backend::WebBackend::default())
.run_str(&code),
should_fail,
)
}),
));
}
Expand Down
2 changes: 1 addition & 1 deletion site/src/uiuisms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ macro_rules! uiuisms {
fn uiuisms() {
for code in [$($code),*] {
println!("Testing Uiuism:\n{code}");
match uiua::Uiua::with_native_sys().run_str(code) {
match uiua::Uiua::with_backend(crate::backend::WebBackend::default()).run_str(code) {
Ok(mut comp) => {
if let Some(diag) = comp.take_diagnostics().into_iter().next() {
panic!("Uiuism failed\n{code}\n{}", diag.report());
Expand Down

0 comments on commit 37f66ba

Please sign in to comment.