diff --git a/tests/all_tests.nut b/tests/all_tests.nut
index 189d19588..0a7f404a9 100644
--- a/tests/all_tests.nut
+++ b/tests/all_tests.nut
@@ -230,6 +230,7 @@ all_tests <- [
 	test_way_tunnel_build_straight,
 	test_way_tunnel_build_up_down,
 	test_way_tunnel_build_above_tunnel_slope,
+	test_way_tunnel_build_across_tunnel_slope,
 	test_way_tunnel_make_public,
 	test_wayobj_build_straight,
 	test_wayobj_build_disconnected,
diff --git a/tests/tests/test_way_tunnel.nut b/tests/tests/test_way_tunnel.nut
index 51bef7472..928a7d460 100644
--- a/tests/tests/test_way_tunnel.nut
+++ b/tests/tests/test_way_tunnel.nut
@@ -449,6 +449,54 @@ function test_way_tunnel_build_above_tunnel_slope()
 }
 
 
+function test_way_tunnel_build_across_tunnel_slope()
+{
+	local pl = player_x(0)
+	local default_tunnel = tunnel_desc_x.get_available_tunnels(wt_road)[0]
+	local digger = command_x(tool_build_tunnel)
+	local remover = command_x(tool_remover)
+	local setslope = command_x.set_slope
+
+	// Prepare area
+	ASSERT_EQUAL(command_x.grid_raise(pl, coord3d(1, 1, 1)), null)
+	ASSERT_EQUAL(command_x.grid_raise(pl, coord3d(2, 1, 1)), null)
+	ASSERT_EQUAL(command_x.grid_raise(pl, coord3d(1, 2, 1)), null)
+	ASSERT_EQUAL(command_x.grid_raise(pl, coord3d(2, 2, 1)), null)
+	ASSERT_EQUAL(command_x.grid_raise(pl, coord3d(1, 3, 1)), null)
+	ASSERT_EQUAL(command_x.grid_raise(pl, coord3d(2, 3, 1)), null)
+
+	{
+		digger.set_flags(2)
+		ASSERT_EQUAL(digger.work(pl, tile_x(1, 0, 0), default_tunnel.get_name()), null)
+		ASSERT_EQUAL(digger.work(pl, tile_x(1, 3, 0), default_tunnel.get_name()), null)
+		digger.set_flags(0)
+
+		// make double slope
+		ASSERT_EQUAL(digger.work(pl, tile_x(1, 0, 0), tile_x(1, 1, 0), default_tunnel.get_name()), null)
+		ASSERT_EQUAL(setslope(pl, coord3d(1, 1, 0), slope.all_down_slope), null)
+		ASSERT_EQUAL(setslope(pl, coord3d(1, 1, -1), slope.all_down_slope), null)
+
+		// try to build across it - should fail and not build anything since the tunnel builder
+		// only builds straight tunnels with no elevation changes
+		ASSERT_EQUAL(digger.work(pl, tile_x(1, 3, 0), tile_x(1, 0, 0), default_tunnel.get_name()), "");
+	}
+
+	// clean up
+	ASSERT_EQUAL(remover.work(pl, coord3d(1, 1, -2)), null)
+	ASSERT_EQUAL(remover.work(pl, coord3d(1, 0,  0)), null)
+	ASSERT_EQUAL(remover.work(pl, coord3d(1, 3,  0)), null)
+
+	ASSERT_EQUAL(command_x.grid_lower(pl, coord3d(1, 1, 1)), null)
+	ASSERT_EQUAL(command_x.grid_lower(pl, coord3d(2, 1, 1)), null)
+	ASSERT_EQUAL(command_x.grid_lower(pl, coord3d(1, 2, 1)), null)
+	ASSERT_EQUAL(command_x.grid_lower(pl, coord3d(2, 2, 1)), null)
+	ASSERT_EQUAL(command_x.grid_lower(pl, coord3d(1, 3, 1)), null)
+	ASSERT_EQUAL(command_x.grid_lower(pl, coord3d(2, 3, 1)), null)
+
+	RESET_ALL_PLAYER_FUNDS()
+}
+
+
 function test_way_tunnel_make_public()
 {
 	local pl = player_x(0)
