MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestHandleZeroAmount

Function TestHandleZeroAmount

model/model_test.go:846–877  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

844}
845
846func TestHandleZeroAmount(t *testing.T) {
847 t.Run("Multiple distributions", func(t *testing.T) {
848 distributions := []Distribution{
849 {Identifier: "id1"},
850 {Identifier: "id2"},
851 {Identifier: "id3"},
852 }
853 result := handleZeroAmount(distributions)
854
855 assert.Len(t, result, 3)
856 assert.Equal(t, big.NewInt(0), result["id1"])
857 assert.Equal(t, big.NewInt(0), result["id2"])
858 assert.Equal(t, big.NewInt(0), result["id3"])
859 })
860
861 t.Run("Single distribution", func(t *testing.T) {
862 distributions := []Distribution{
863 {Identifier: "single"},
864 }
865 result := handleZeroAmount(distributions)
866
867 assert.Len(t, result, 1)
868 assert.Equal(t, big.NewInt(0), result["single"])
869 })
870
871 t.Run("Empty distributions", func(t *testing.T) {
872 distributions := []Distribution{}
873 result := handleZeroAmount(distributions)
874
875 assert.Len(t, result, 0)
876 })
877}
878
879func TestCheckCondition_Extended(t *testing.T) {
880 balance := &Balance{

Callers

nothing calls this directly

Calls 1

handleZeroAmountFunction · 0.85

Tested by

no test coverage detected