mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
put inspect tests in their own module
This commit is contained in:
parent
3434d3154a
commit
2e486953be
1 changed files with 59 additions and 48 deletions
|
@ -2181,9 +2181,22 @@ fn issue_4772_weakened_monomorphic_destructure() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod inspect {
|
||||||
|
#[cfg(feature = "gen-llvm")]
|
||||||
|
use crate::helpers::llvm::assert_evals_to;
|
||||||
|
|
||||||
|
#[cfg(feature = "gen-wasm")]
|
||||||
|
use crate::helpers::wasm::assert_evals_to;
|
||||||
|
|
||||||
|
#[cfg(all(test, any(feature = "gen-llvm", feature = "gen-wasm")))]
|
||||||
|
use indoc::indoc;
|
||||||
|
|
||||||
|
#[cfg(all(test, any(feature = "gen-llvm", feature = "gen-wasm")))]
|
||||||
|
use roc_std::RocStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
fn inspect_bool() {
|
fn bool() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
|
@ -2202,16 +2215,13 @@ fn inspect_bool() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
fn inspect_num() {
|
fn num() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
app "test" provides [main] to "./platform"
|
app "test" provides [main] to "./platform"
|
||||||
|
|
||||||
main = [
|
main = [
|
||||||
Inspect.inspect 42, # Num *
|
|
||||||
Inspect.inspect 0x5, # Int *
|
|
||||||
Inspect.inspect (0.1 + 0.2), # Frac *
|
|
||||||
Inspect.inspect 1u8, # U8
|
Inspect.inspect 1u8, # U8
|
||||||
Inspect.inspect 2i8, # I8
|
Inspect.inspect 2i8, # I8
|
||||||
Inspect.inspect 3u16, # U16
|
Inspect.inspect 3u16, # U16
|
||||||
|
@ -2235,7 +2245,7 @@ fn inspect_num() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
fn inspect_list() {
|
fn list() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
|
@ -2258,7 +2268,7 @@ fn inspect_list() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
fn inspect_str() {
|
fn str() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
|
@ -2277,3 +2287,4 @@ fn inspect_str() {
|
||||||
RocStr
|
RocStr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue