From c8b989a75c6abeb1006524468722e8d62dde41ed Mon Sep 17 00:00:00 2001 From: bitromortac Date: Thu, 7 Nov 2024 11:56:46 +0100 Subject: [PATCH] routing: add test for fuzz test special case --- routing/probability_bimodal_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/routing/probability_bimodal_test.go b/routing/probability_bimodal_test.go index 4535814c3..30fac41d7 100644 --- a/routing/probability_bimodal_test.go +++ b/routing/probability_bimodal_test.go @@ -309,6 +309,20 @@ func TestIntegral(t *testing.T) { } } +// TestSpecialCase tests a value combination found by fuzz tests. +func TestSpecialCase(t *testing.T) { + estimator := BimodalEstimator{ + BimodalConfig: BimodalConfig{ + BimodalScaleMsat: lnwire.MilliSatoshi(400_000), + }, + } + + _, err := estimator.probabilityFormula( + 1_000_000_000, 300_000_000, 400_000_000, 300_000_000, + ) + require.Error(t, err) +} + // TestCanSend tests that the success amount drops to zero over time. func TestCanSend(t *testing.T) { t.Parallel()