exercism / go-test-runner

GNU Affero General Public License v3.0
15 stars 17 forks source link

Stack overflow is not properly reported on the website #81

Closed meatball133 closed 2 years ago

meatball133 commented 2 years ago

In the gross store exercises. Using the following code will generate a blank error message on the website:

func GetItem(bill map[string]int, item string) (int, bool) { qty , ok := GetItem(bill, item) return qty, ok }

meatball133 commented 2 years ago

image

meatball133 commented 2 years ago
package gross

// Units stores the Gross Store unit measurements.
func Units() map[string]int {
    messurements := make(map[string]int)
    messurements["quarter_of_a_dozen"] = 3 
    messurements["half_of_a_dozen"] = 6
    messurements["dozen"] = 12
    messurements["small_gross"] = 120
    messurements["gross"] = 144
    messurements["great_gross"] = 1728
    return messurements
}

// NewBill creates a new bill.
func NewBill() map[string]int {
    bill := make(map[string]int)
    return bill
}

// AddItem adds an item to customer bill.
func AddItem(bill, units map[string]int, item, unit string) bool {
    if _, exists := units[unit]; exists{
        bill[item] += units[unit]
        return true
    }

return false
}

// RemoveItem removes an item from customer bill.
func RemoveItem(bill, units map[string]int, item, unit string) bool {
    _, exists := units[unit]
    result := false
    if exists && bill[item] >= units[unit]{
        bill[item] -= units[unit]
    result = true}
    if bill[item]== 0{
        delete(bill, item)

}
return result}
// GetItem returns the quantity of an item that the customer has in his/her bill.
func GetItem(bill map[string]int, item string) (int, bool) {
    qty , ok := GetItem(bill, item)
    return qty, ok
}
meatball133 commented 2 years ago

full code

junedev commented 2 years ago

This is strange. It should report a stack overflow and I wrote a fix for the test runner recently that should cover this case but it does not seem to work in this scenario. Anyway, thanks for reporting. I will move the issue to the test runner repository and take a closer look later on.

junedev commented 2 years ago

I put the code through the test runner locally and there, the output json is correct. However, the "message" for the test case that produces the stack overflow is very long. According to the official docs, this should not be an issue. :woman_shrugging:

The message value is not limited in length.

@exercism/maintainers-admin Should we try to shorten the message length and see whether that resolves the issue on the website or do you have another idea why this issue is happening?

ErikSchierboom commented 2 years ago

@junedev I've looked into this and this is caused by the results.json not having the right contents. This is what I get when I run the provided code:

{
    "status": "error",
    "version": 2,
    "tests": [
        {
            "name": "TestUnits",
            "status": "pass",
            "test_code": "func TestUnits(t *testing.T) {\n\ttests := []struct {\n\t\tname\tstring\n\t\tqty\tint\n\t}{\n\t\t{\"quarter_of_a_dozen\", 3},\n\t\t{\"half_of_a_dozen\", 6},\n\t\t{\"dozen\", 12},\n\t\t{\"small_gross\", 120},\n\t\t{\"gross\", 144},\n\t\t{\"great_gross\", 1728},\n\t}\n\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tqty, ok := units[tt.name]\n\n\t\tif !ok {\n\t\t\tt.Errorf(`Unit \"%s\" not found!`, tt.name)\n\t\t\tcontinue\n\t\t}\n\n\t\tif qty != tt.qty {\n\t\t\tt.Errorf(`Unit \"%s\" should have quantity %d, found %d`, tt.name, tt.qty, qty)\n\t\t}\n\t}\n\n}",
            "message": "\n=== RUN   TestUnits\n\n--- PASS: TestUnits (0.00s)\n"
        },
        {
            "name": "TestAddItem/Invalid_measurement_unit",
            "status": "pass",
            "test_code": "func TestAddItem(t *testing.T) {\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tentry\t\t[]entry\n\t\texpected\tbool\n\t}{\n\t\t{\n\t\t\t\"Invalid measurement unit\",\n\t\t\t[]entry{\n\t\t\t\t{\"pasta\", \"\", 0},\n\t\t\t\t{\"onion\", \"quarter\", 0},\n\t\t\t\t{\"pasta\", \"pound\", 0},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\t\"Valid measurement unit\",\n\t\t\t[]entry{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 3},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 6},\n\t\t\t\t{\"chili\", \"dozen\", 12},\n\t\t\t\t{\"cucumber\", \"small_gross\", 120},\n\t\t\t\t{\"potato\", \"gross\", 144},\n\t\t\t\t{\"zucchini\", \"great_gross\", 1728},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\n\t\t\t\"check quantity of item added twice\",\n\t\t\t[]entry{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 3},\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 6},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 6},\n\t\t\t\t{\"tomato\", \"quarter_of_a_dozen\", 9},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := NewBill()\n\t\t\tfor _, item := range tt.entry {\n\t\t\t\tok := AddItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from AddItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestAddItem/Invalid_measurement_unit\n\n    --- PASS: TestAddItem/Invalid_measurement_unit (0.00s)\n"
        },
        {
            "name": "TestAddItem/Valid_measurement_unit",
            "status": "pass",
            "test_code": "func TestAddItem(t *testing.T) {\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tentry\t\t[]entry\n\t\texpected\tbool\n\t}{\n\t\t{\n\t\t\t\"Invalid measurement unit\",\n\t\t\t[]entry{\n\t\t\t\t{\"pasta\", \"\", 0},\n\t\t\t\t{\"onion\", \"quarter\", 0},\n\t\t\t\t{\"pasta\", \"pound\", 0},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\t\"Valid measurement unit\",\n\t\t\t[]entry{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 3},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 6},\n\t\t\t\t{\"chili\", \"dozen\", 12},\n\t\t\t\t{\"cucumber\", \"small_gross\", 120},\n\t\t\t\t{\"potato\", \"gross\", 144},\n\t\t\t\t{\"zucchini\", \"great_gross\", 1728},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\n\t\t\t\"check quantity of item added twice\",\n\t\t\t[]entry{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 3},\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 6},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 6},\n\t\t\t\t{\"tomato\", \"quarter_of_a_dozen\", 9},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := NewBill()\n\t\t\tfor _, item := range tt.entry {\n\t\t\t\tok := AddItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from AddItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestAddItem/Valid_measurement_unit\n\n    --- PASS: TestAddItem/Valid_measurement_unit (0.00s)\n"
        },
        {
            "name": "TestAddItem/check_quantity_of_item_added_twice",
            "status": "pass",
            "test_code": "func TestAddItem(t *testing.T) {\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tentry\t\t[]entry\n\t\texpected\tbool\n\t}{\n\t\t{\n\t\t\t\"Invalid measurement unit\",\n\t\t\t[]entry{\n\t\t\t\t{\"pasta\", \"\", 0},\n\t\t\t\t{\"onion\", \"quarter\", 0},\n\t\t\t\t{\"pasta\", \"pound\", 0},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\n\t\t\t\"Valid measurement unit\",\n\t\t\t[]entry{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 3},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 6},\n\t\t\t\t{\"chili\", \"dozen\", 12},\n\t\t\t\t{\"cucumber\", \"small_gross\", 120},\n\t\t\t\t{\"potato\", \"gross\", 144},\n\t\t\t\t{\"zucchini\", \"great_gross\", 1728},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\n\t\t\t\"check quantity of item added twice\",\n\t\t\t[]entry{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 3},\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 6},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 6},\n\t\t\t\t{\"tomato\", \"quarter_of_a_dozen\", 9},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := NewBill()\n\t\t\tfor _, item := range tt.entry {\n\t\t\t\tok := AddItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from AddItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestAddItem/check_quantity_of_item_added_twice\n\n    --- PASS: TestAddItem/check_quantity_of_item_added_twice (0.00s)\n"
        },
        {
            "name": "TestRemoveItem/Item_Not_found_in_bill",
            "status": "pass",
            "test_code": "func TestRemoveItem(t *testing.T) {\n\ttype expectedItem struct {\n\t\tname\tstring\n\t\tunit\tstring\n\t\tqty\tint\n\t\texists\tbool\n\t}\n\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tremove\t\t[]expectedItem\n\t\texpected\tbool\n\t}{\n\t\t{\"Item Not found in bill\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"papaya\", \"gross\", 0, false},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Invalid measurement unit\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"pound\", 3, true},\n\t\t\t\t{\"tomato\", \"kilogram\", 6, true},\n\t\t\t\t{\"cucumber\", \"stone\", 120, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Resulted qty less than 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"half_of_a_dozen\", 3, true},\n\t\t\t\t{\"tomato\", \"dozen\", 6, true},\n\t\t\t\t{\"chili\", \"small_gross\", 12, true},\n\t\t\t\t{\"cucumber\", \"gross\", 120, true},\n\t\t\t\t{\"potato\", \"great_gross\", 144, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Should delete the item if 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 0, false},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 0, false},\n\t\t\t\t{\"chili\", \"dozen\", 0, false},\n\t\t\t\t{\"cucumber\", \"small_gross\", 0, false},\n\t\t\t\t{\"potato\", \"gross\", 0, false},\n\t\t\t\t{\"zucchini\", \"great_gross\", 0, false},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\"Should reduce the qty\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"chili\", \"half_of_a_dozen\", 6, true},\n\t\t\t\t{\"cucumber\", \"dozen\", 108, true},\n\t\t\t\t{\"zucchini\", \"gross\", 1584, true},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := setupInitialBillData()\n\t\t\tfor _, item := range tt.remove {\n\t\t\t\tok := RemoveItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from RemoveItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != item.exists {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestRemoveItem/Item_Not_found_in_bill\n\n    --- PASS: TestRemoveItem/Item_Not_found_in_bill (0.00s)\n"
        },
        {
            "name": "TestRemoveItem/Invalid_measurement_unit",
            "status": "pass",
            "test_code": "func TestRemoveItem(t *testing.T) {\n\ttype expectedItem struct {\n\t\tname\tstring\n\t\tunit\tstring\n\t\tqty\tint\n\t\texists\tbool\n\t}\n\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tremove\t\t[]expectedItem\n\t\texpected\tbool\n\t}{\n\t\t{\"Item Not found in bill\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"papaya\", \"gross\", 0, false},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Invalid measurement unit\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"pound\", 3, true},\n\t\t\t\t{\"tomato\", \"kilogram\", 6, true},\n\t\t\t\t{\"cucumber\", \"stone\", 120, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Resulted qty less than 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"half_of_a_dozen\", 3, true},\n\t\t\t\t{\"tomato\", \"dozen\", 6, true},\n\t\t\t\t{\"chili\", \"small_gross\", 12, true},\n\t\t\t\t{\"cucumber\", \"gross\", 120, true},\n\t\t\t\t{\"potato\", \"great_gross\", 144, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Should delete the item if 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 0, false},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 0, false},\n\t\t\t\t{\"chili\", \"dozen\", 0, false},\n\t\t\t\t{\"cucumber\", \"small_gross\", 0, false},\n\t\t\t\t{\"potato\", \"gross\", 0, false},\n\t\t\t\t{\"zucchini\", \"great_gross\", 0, false},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\"Should reduce the qty\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"chili\", \"half_of_a_dozen\", 6, true},\n\t\t\t\t{\"cucumber\", \"dozen\", 108, true},\n\t\t\t\t{\"zucchini\", \"gross\", 1584, true},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := setupInitialBillData()\n\t\t\tfor _, item := range tt.remove {\n\t\t\t\tok := RemoveItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from RemoveItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != item.exists {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestRemoveItem/Invalid_measurement_unit\n\n    --- PASS: TestRemoveItem/Invalid_measurement_unit (0.00s)\n"
        },
        {
            "name": "TestRemoveItem/Resulted_qty_less_than_0",
            "status": "pass",
            "test_code": "func TestRemoveItem(t *testing.T) {\n\ttype expectedItem struct {\n\t\tname\tstring\n\t\tunit\tstring\n\t\tqty\tint\n\t\texists\tbool\n\t}\n\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tremove\t\t[]expectedItem\n\t\texpected\tbool\n\t}{\n\t\t{\"Item Not found in bill\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"papaya\", \"gross\", 0, false},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Invalid measurement unit\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"pound\", 3, true},\n\t\t\t\t{\"tomato\", \"kilogram\", 6, true},\n\t\t\t\t{\"cucumber\", \"stone\", 120, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Resulted qty less than 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"half_of_a_dozen\", 3, true},\n\t\t\t\t{\"tomato\", \"dozen\", 6, true},\n\t\t\t\t{\"chili\", \"small_gross\", 12, true},\n\t\t\t\t{\"cucumber\", \"gross\", 120, true},\n\t\t\t\t{\"potato\", \"great_gross\", 144, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Should delete the item if 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 0, false},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 0, false},\n\t\t\t\t{\"chili\", \"dozen\", 0, false},\n\t\t\t\t{\"cucumber\", \"small_gross\", 0, false},\n\t\t\t\t{\"potato\", \"gross\", 0, false},\n\t\t\t\t{\"zucchini\", \"great_gross\", 0, false},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\"Should reduce the qty\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"chili\", \"half_of_a_dozen\", 6, true},\n\t\t\t\t{\"cucumber\", \"dozen\", 108, true},\n\t\t\t\t{\"zucchini\", \"gross\", 1584, true},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := setupInitialBillData()\n\t\t\tfor _, item := range tt.remove {\n\t\t\t\tok := RemoveItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from RemoveItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != item.exists {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestRemoveItem/Resulted_qty_less_than_0\n\n    --- PASS: TestRemoveItem/Resulted_qty_less_than_0 (0.00s)\n"
        },
        {
            "name": "TestRemoveItem/Should_delete_the_item_if_0",
            "status": "pass",
            "test_code": "func TestRemoveItem(t *testing.T) {\n\ttype expectedItem struct {\n\t\tname\tstring\n\t\tunit\tstring\n\t\tqty\tint\n\t\texists\tbool\n\t}\n\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tremove\t\t[]expectedItem\n\t\texpected\tbool\n\t}{\n\t\t{\"Item Not found in bill\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"papaya\", \"gross\", 0, false},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Invalid measurement unit\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"pound\", 3, true},\n\t\t\t\t{\"tomato\", \"kilogram\", 6, true},\n\t\t\t\t{\"cucumber\", \"stone\", 120, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Resulted qty less than 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"half_of_a_dozen\", 3, true},\n\t\t\t\t{\"tomato\", \"dozen\", 6, true},\n\t\t\t\t{\"chili\", \"small_gross\", 12, true},\n\t\t\t\t{\"cucumber\", \"gross\", 120, true},\n\t\t\t\t{\"potato\", \"great_gross\", 144, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Should delete the item if 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 0, false},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 0, false},\n\t\t\t\t{\"chili\", \"dozen\", 0, false},\n\t\t\t\t{\"cucumber\", \"small_gross\", 0, false},\n\t\t\t\t{\"potato\", \"gross\", 0, false},\n\t\t\t\t{\"zucchini\", \"great_gross\", 0, false},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\"Should reduce the qty\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"chili\", \"half_of_a_dozen\", 6, true},\n\t\t\t\t{\"cucumber\", \"dozen\", 108, true},\n\t\t\t\t{\"zucchini\", \"gross\", 1584, true},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := setupInitialBillData()\n\t\t\tfor _, item := range tt.remove {\n\t\t\t\tok := RemoveItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from RemoveItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != item.exists {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestRemoveItem/Should_delete_the_item_if_0\n\n    --- PASS: TestRemoveItem/Should_delete_the_item_if_0 (0.00s)\n"
        },
        {
            "name": "TestRemoveItem/Should_reduce_the_qty",
            "status": "pass",
            "test_code": "func TestRemoveItem(t *testing.T) {\n\ttype expectedItem struct {\n\t\tname\tstring\n\t\tunit\tstring\n\t\tqty\tint\n\t\texists\tbool\n\t}\n\n\ttests := []struct {\n\t\tname\t\tstring\n\t\tremove\t\t[]expectedItem\n\t\texpected\tbool\n\t}{\n\t\t{\"Item Not found in bill\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"papaya\", \"gross\", 0, false},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Invalid measurement unit\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"pound\", 3, true},\n\t\t\t\t{\"tomato\", \"kilogram\", 6, true},\n\t\t\t\t{\"cucumber\", \"stone\", 120, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Resulted qty less than 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"half_of_a_dozen\", 3, true},\n\t\t\t\t{\"tomato\", \"dozen\", 6, true},\n\t\t\t\t{\"chili\", \"small_gross\", 12, true},\n\t\t\t\t{\"cucumber\", \"gross\", 120, true},\n\t\t\t\t{\"potato\", \"great_gross\", 144, true},\n\t\t\t},\n\t\t\tfalse,\n\t\t},\n\t\t{\"Should delete the item if 0\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", \"quarter_of_a_dozen\", 0, false},\n\t\t\t\t{\"tomato\", \"half_of_a_dozen\", 0, false},\n\t\t\t\t{\"chili\", \"dozen\", 0, false},\n\t\t\t\t{\"cucumber\", \"small_gross\", 0, false},\n\t\t\t\t{\"potato\", \"gross\", 0, false},\n\t\t\t\t{\"zucchini\", \"great_gross\", 0, false},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t\t{\"Should reduce the qty\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"chili\", \"half_of_a_dozen\", 6, true},\n\t\t\t\t{\"cucumber\", \"dozen\", 108, true},\n\t\t\t\t{\"zucchini\", \"gross\", 1584, true},\n\t\t\t},\n\t\t\ttrue,\n\t\t},\n\t}\n\n\tunits := Units()\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := setupInitialBillData()\n\t\t\tfor _, item := range tt.remove {\n\t\t\t\tok := RemoveItem(bill, units, item.name, item.unit)\n\t\t\t\tif ok != tt.expected {\n\t\t\t\t\tt.Errorf(\"Expected %t from RemoveItem, found %t at %v\", tt.expected, ok, item.name)\n\t\t\t\t}\n\n\t\t\t\titemQty, ok := bill[item.name]\n\t\t\t\tif ok != item.exists {\n\t\t\t\t\tt.Errorf(\"Could not find item %s in customer bill\", item.name)\n\t\t\t\t}\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestRemoveItem/Should_reduce_the_qty\n\n    --- PASS: TestRemoveItem/Should_reduce_the_qty (0.00s)\n"
        },
        {
            "name": "TestNewBill/Should_reset_customerbill",
            "status": "pass",
            "test_code": "func TestNewBill(t *testing.T) {\n\t// Success, zero out the  bill\n\tt.Run(\"Should reset customerbill\", func(t *testing.T) {\n\t\tbill := NewBill()\n\n\t\tif len(bill) != 0 {\n\t\t\tt.Error(\"Customer bill must be empty\")\n\t\t}\n\t})\n}",
            "message": "\n=== RUN   TestNewBill/Should_reset_customerbill\n\n    --- PASS: TestNewBill/Should_reset_customerbill (0.00s)\n"
        },
        {
            "name": "TestGetItem/Item_Not_found_in_bill",
            "status": "error",
            "test_code": "func TestGetItem(t *testing.T) {\n\ttype expectedItem struct {\n\t\tname\t\tstring\n\t\texpected\tbool\n\t\tqty\t\tint\n\t}\n\n\ttest := []struct {\n\t\tname\tstring\n\t\tgetItem\t[]expectedItem\n\t}{\n\t\t{\n\t\t\t\"Item Not found in bill\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"grape\", false, 0},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"Success\",\n\t\t\t[]expectedItem{\n\t\t\t\t{\"peas\", true, 3},\n\t\t\t\t{\"tomato\", true, 6},\n\t\t\t\t{\"chili\", true, 12},\n\t\t\t\t{\"cucumber\", true, 120},\n\t\t\t\t{\"potato\", true, 144},\n\t\t\t\t{\"zucchini\", true, 1728},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range test {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tbill := setupInitialBillData()\n\t\t\tfor _, item := range tt.getItem {\n\t\t\t\titemQty, ok := GetItem(bill, item.name)\n\n\t\t\t\tif ok != item.expected {\n\t\t\t\t\tmsg := \"Could not find item %s in customer bill, expected %t\"\n\t\t\t\t\tif item.expected == false {\n\t\t\t\t\t\tmsg = \"Found item %s in customer bill, expected %t\"\n\t\t\t\t\t}\n\n\t\t\t\t\tt.Errorf(msg, item.name, item.expected)\n\t\t\t\t}\n\n\t\t\t\tif itemQty != item.qty {\n\t\t\t\t\tt.Errorf(\"Expected %s to have quantity %d in customer bill, found %d\", item.name, item.qty, itemQty)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}",
            "message": "\n=== RUN   TestGetItem/Item_Not_found_in_bill\n\nruntime: goroutine stack exceeds 1000000000-byte limit\n\nruntime: sp=0xc020160398 stack=[0xc020160000, 0xc040160000]\n\nfatal error: stack overflow\n\n\n\nruntime stack:\n\nruntime.throw({0x5230ec?, 0x5e6e80?})\n\n\t/usr/local/go/src/runtime/panic.go:992 +0x71\n\nruntime.newstack()\n\n\t/usr/local/go/src/runtime/stack.go:1101 +0x5cc\n\nruntime.morestack()\n\n\t/usr/local/go/src/runtime/asm_amd64.s:547 +0x8b\n\n\n\ngoroutine 32 [running]:\n\ngross.GetItem(0xc04015fe30?, {0x521286?, 0x5?})\n\n\t/mnt/exercism-iteration/gross_store.go:44 +0x3c fp=0xc0201603a8 sp=0xc0201603a0 pc=0x4efa1c\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201603d0 sp=0xc0201603a8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201603f8 sp=0xc0201603d0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160420 sp=0xc0201603f8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160448 sp=0xc020160420 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160470 sp=0xc020160448 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160498 sp=0xc020160470 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201604c0 sp=0xc020160498 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201604e8 sp=0xc0201604c0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160510 sp=0xc0201604e8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160538 sp=0xc020160510 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160560 sp=0xc020160538 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160588 sp=0xc020160560 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201605b0 sp=0xc020160588 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201605d8 sp=0xc0201605b0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160600 sp=0xc0201605d8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160628 sp=0xc020160600 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160650 sp=0xc020160628 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160678 sp=0xc020160650 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201606a0 sp=0xc020160678 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201606c8 sp=0xc0201606a0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201606f0 sp=0xc0201606c8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160718 sp=0xc0201606f0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160740 sp=0xc020160718 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160768 sp=0xc020160740 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160790 sp=0xc020160768 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201607b8 sp=0xc020160790 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201607e0 sp=0xc0201607b8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160808 sp=0xc0201607e0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160830 sp=0xc020160808 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160858 sp=0xc020160830 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160880 sp=0xc020160858 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201608a8 sp=0xc020160880 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201608d0 sp=0xc0201608a8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201608f8 sp=0xc0201608d0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160920 sp=0xc0201608f8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160948 sp=0xc020160920 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160970 sp=0xc020160948 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160998 sp=0xc020160970 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201609c0 sp=0xc020160998 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201609e8 sp=0xc0201609c0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160a10 sp=0xc0201609e8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160a38 sp=0xc020160a10 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160a60 sp=0xc020160a38 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160a88 sp=0xc020160a60 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160ab0 sp=0xc020160a88 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160ad8 sp=0xc020160ab0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160b00 sp=0xc020160ad8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160b28 sp=0xc020160b00 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160b50 sp=0xc020160b28 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160b78 sp=0xc020160b50 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160ba0 sp=0xc020160b78 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160bc8 sp=0xc020160ba0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160bf0 sp=0xc020160bc8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160c18 sp=0xc020160bf0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160c40 sp=0xc020160c18 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160c68 sp=0xc020160c40 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160c90 sp=0xc020160c68 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160cb8 sp=0xc020160c90 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160ce0 sp=0xc020160cb8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160d08 sp=0xc020160ce0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160d30 sp=0xc020160d08 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160d58 sp=0xc020160d30 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160d80 sp=0xc020160d58 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160da8 sp=0xc020160d80 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160dd0 sp=0xc020160da8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160df8 sp=0xc020160dd0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160e20 sp=0xc020160df8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160e48 sp=0xc020160e20 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160e70 sp=0xc020160e48 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160e98 sp=0xc020160e70 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160ec0 sp=0xc020160e98 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160ee8 sp=0xc020160ec0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160f10 sp=0xc020160ee8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160f38 sp=0xc020160f10 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160f60 sp=0xc020160f38 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160f88 sp=0xc020160f60 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160fb0 sp=0xc020160f88 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020160fd8 sp=0xc020160fb0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161000 sp=0xc020160fd8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161028 sp=0xc020161000 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161050 sp=0xc020161028 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161078 sp=0xc020161050 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201610a0 sp=0xc020161078 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201610c8 sp=0xc0201610a0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201610f0 sp=0xc0201610c8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161118 sp=0xc0201610f0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161140 sp=0xc020161118 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161168 sp=0xc020161140 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161190 sp=0xc020161168 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201611b8 sp=0xc020161190 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201611e0 sp=0xc0201611b8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161208 sp=0xc0201611e0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161230 sp=0xc020161208 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161258 sp=0xc020161230 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161280 sp=0xc020161258 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201612a8 sp=0xc020161280 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201612d0 sp=0xc0201612a8 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc0201612f8 sp=0xc0201612d0 pc=0x4ef9fe\n\ngross.GetItem(0x0?, {0x521286?, 0x0?})\n\n\t/mnt/exercism-iteration/gross_store.go:45 +0x1e fp=0xc020161320 sp=0xc0201612f8 pc=0x4ef9fe\n\n...additional frames elided...\n\ncreated by testing.(*T).Run\n\n\t/usr/local/go/src/testing/testing.go:1486 +0x35f\n\n\n\ngoroutine 1 [chan receive]:\n\ntesting.(*T).Run(0xc00008b1e0, {0x522513?, 0x4b3345?}, 0x52bff0)\n\n\t/usr/local/go/src/testing/testing.go:1487 +0x37a\n\ntesting.runTests.func1(0xc0000aa390?)\n\n\t/usr/local/go/src/testing/testing.go:1839 +0x6e\n\ntesting.tRunner(0xc00008b1e0, 0xc0000a2cd8)\n\n\t/usr/local/go/src/testing/testing.go:1439 +0x102\n\ntesting.runTests(0xc0000c8140?, {0x5fa2a0, 0x5, 0x5}, {0x7ff408e935b8?, 0x40?, 0x5fea20?})\n\n\t/usr/local/go/src/testing/testing.go:1837 +0x457\n\ntesting.(*M).Run(0xc0000c8140)\n\n\t/usr/local/go/src/testing/testing.go:1719 +0x5d9\n\nmain.main()\n\n\t_testmain.go:55 +0x1aa\n\n\n\ngoroutine 31 [chan receive]:\n\ntesting.(*T).Run(0xc0000f6d00, {0x524ecc?, 0x5d6600?}, 0xc0000a6780)\n\n\t/usr/local/go/src/testing/testing.go:1487 +0x37a\n\ngross.TestGetItem(0xc0000f6b60?)\n\n\t/mnt/exercism-iteration/gross_store_test.go:224 +0x267\n\ntesting.tRunner(0xc0000f6d00, 0x52bff0)\n\n\t/usr/local/go/src/testing/testing.go:1439 +0x102\n\ncreated by testing.(*T).Run\n\n\t/usr/local/go/src/testing/testing.go:1486 +0x35f\n"
        }
    ]
}

You can see that the status field is set to error, in which case the message field should be displayed, but that field is not specified.

junedev commented 2 years ago

Thanks a lot @ErikSchierboom. I did not notice this wrong combination of fields. Will fix it when I have some time.

andrerfcsantos commented 2 years ago

@meatball133 This issue should now be fixed. Pasting the code you posted above now only reports 1 test as failing, with this error. Thanks for reporting!

image