package rules

import "testing"

// Help function for testing
// Check if map has needed key and this key has needed value
// Write message if some error occur
func testMap(m map[string]interface{}, name string, value interface{}, t *testing.T) {
	v, ok := m[name]
	if !ok {
		t.Errorf("No key with name %v in map %v", name, m)
	}

	if v != value {
		t.Errorf("Bad map value, expect %v (%T), got %v (%T)", value, value, v, v)
	}
}
