Skip to content

Commit

Permalink
fix unused results in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Jan 29, 2024
1 parent 2040f8b commit cf7a974
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 201 deletions.
8 changes: 4 additions & 4 deletions tree_shared/src/id_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn test_id_analysis_no_invalid_entry() {
let build = "(let some-expr (Not (Boolean (Id (i64-fresh!)) false))";
let check = "(fail (check (ExprHasRefId some-expr any-id)))";

let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}

// Create an id conflict for an Expr on purpose and check that we catch it
Expand All @@ -136,7 +136,7 @@ fn test_id_analysis_expr_id_conflict_panics_if_valid() {
(ExprIsValid conflict-expr)";
let check = "";

let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}

#[test]
Expand All @@ -150,7 +150,7 @@ fn test_id_analysis_listexpr_id_conflict_panics() {
(ListExprIsValid conflict-expr)";
let check = "";

let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}

#[test]
Expand All @@ -165,5 +165,5 @@ fn test_shared_unique_id_mix_panics() {
(Num id2 1)))
(ExprIsValid conflict-expr)";
let check = "";
let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}
11 changes: 10 additions & 1 deletion tree_shared/src/ir.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::iter;
use std::{
fmt::{Display, Formatter},
iter,
};
use strum_macros::EnumIter;

#[derive(Clone, Copy, Debug, PartialEq)]
Expand Down Expand Up @@ -118,6 +121,12 @@ impl Field {
}
}

impl Display for Constructor {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.name())
}
}

impl Constructor {
pub(crate) fn name(&self) -> &'static str {
match self {
Expand Down
2 changes: 2 additions & 0 deletions tree_shared/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod ast;
pub(crate) mod deep_copy;
pub(crate) mod error_checking;
pub(crate) mod id_analysis;
pub mod interpreter;
pub(crate) mod ir;
Expand Down Expand Up @@ -142,6 +143,7 @@ pub fn run_test(build: &str, check: &str) -> Result {
&deep_copy::deep_copy_rules().join("\n"),
include_str!("sugar.egg"),
&util::rules().join("\n"),
&error_checking::error_checking_rules().join("\n"),
&id_analysis::id_analysis_rules().join("\n"),
// optimizations
include_str!("simple.egg"),
Expand Down
193 changes: 0 additions & 193 deletions tree_shared/src/switch_rewrites.rs

This file was deleted.

6 changes: 3 additions & 3 deletions tree_shared/src/type_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ fn loop_pred_boolean() {
(run-schedule (saturate type-analysis))";
let check = "";

let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}

#[test]
Expand All @@ -176,7 +176,7 @@ fn loop_args1() {
(run-schedule (saturate type-analysis))";
let check = "";

let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}

#[test]
Expand All @@ -194,5 +194,5 @@ fn loop_args3() {
(run-schedule (saturate type-analysis))";
let check = "";

let _ = crate::run_test(build, check);
crate::run_test(build, check).unwrap()
}

0 comments on commit cf7a974

Please sign in to comment.