fix: tests
This commit is contained in:
parent
472946f85d
commit
86f3f5794d
@ -579,7 +579,7 @@ fn test_normal_surface_noisified() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_config_final_density() {
|
fn test_config_final_density() {
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/final_density_dump_7_4.json");
|
read_data_from_file!("../../../../../assets/final_density_dump_7_4.json");
|
||||||
|
|
||||||
let router = &OVERWORLD_BASE_NOISE_ROUTER.noise;
|
let router = &OVERWORLD_BASE_NOISE_ROUTER.noise;
|
||||||
let proto_stack =
|
let proto_stack =
|
||||||
@ -645,8 +645,9 @@ macro_rules! read_data_from_file_json5 {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static DENSITY_FUNCTION_REPRS: LazyLock<DensityFunctionReprs> =
|
static DENSITY_FUNCTION_REPRS: LazyLock<DensityFunctionReprs> = LazyLock::new(|| {
|
||||||
LazyLock::new(|| read_data_from_file_json5!("../../../../assets/density_function_tests.json"));
|
read_data_from_file_json5!("../../../../../assets/density_function_tests.json")
|
||||||
|
});
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_base_sloped_cheese() {
|
fn test_base_sloped_cheese() {
|
||||||
@ -656,7 +657,7 @@ fn test_base_sloped_cheese() {
|
|||||||
let mut function = build_function!(stack);
|
let mut function = build_function!(stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_sloped_cheese_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_sloped_cheese_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -675,7 +676,7 @@ fn test_base_factor() {
|
|||||||
let mut function = build_function!(stack);
|
let mut function = build_function!(stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_factor_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_factor_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -694,7 +695,7 @@ fn test_base_depth() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_depth_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_depth_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -713,7 +714,7 @@ fn test_base_offset() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_offset_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_offset_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -732,7 +733,7 @@ fn test_base_cave_entrances() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_cave_entrances_overworld_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_cave_entrances_overworld_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -751,7 +752,7 @@ fn test_base_3d_noise() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_3d_overworld_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_3d_overworld_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -772,7 +773,7 @@ fn test_base_spahetti_roughness() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> = read_data_from_file!(
|
let expected_data: Vec<(i32, i32, i32, f64)> = read_data_from_file!(
|
||||||
"../../../../assets/converted_cave_spaghetti_rough_overworld_7_4.json"
|
"../../../../../assets/converted_cave_spaghetti_rough_overworld_7_4.json"
|
||||||
);
|
);
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
@ -792,7 +793,7 @@ fn test_base_cave_noodle() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_cave_noodle_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_cave_noodle_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -811,7 +812,7 @@ fn test_base_cave_pillars() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_cave_pillar_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_cave_pillar_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
@ -832,7 +833,7 @@ fn test_base_spaghetti_2d_thickness() {
|
|||||||
let mut function = build_function!(function_stack);
|
let mut function = build_function!(function_stack);
|
||||||
|
|
||||||
let expected_data: Vec<(i32, i32, i32, f64)> =
|
let expected_data: Vec<(i32, i32, i32, f64)> =
|
||||||
read_data_from_file!("../../../../assets/converted_cave_spaghetti_2d_thicc_7_4.json");
|
read_data_from_file!("../../../../../assets/converted_cave_spaghetti_2d_thicc_7_4.json");
|
||||||
for (x, y, z, sample) in expected_data {
|
for (x, y, z, sample) in expected_data {
|
||||||
let pos = TestNoisePos { x, y, z };
|
let pos = TestNoisePos { x, y, z };
|
||||||
assert_eq_delta!(
|
assert_eq_delta!(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user