Prompt:
package check_dict_case_test

import (
    "testing"
    "fmt"
)

// Given a dictionary, return True if all keys are strings in lower
// case or all keys are strings in upper case, else return False.
// The function should return False is the given dictionary is empty.
// Examples:
// >>> check_dict_case(map[string]string{"a": "apple", "b": "banana"})
// true
// >>> check_dict_case(map[string]string{"a": "apple", "A": "banana", "B": "banana"})
// false
// >>> check_dict_case(map[interface{}]string{"a": "apple", 8: "banana", "a": "apple"})
// false
// >>> check_dict_case(map[string]string{"Name": "John", "Age": "36", "City": "Houston"})
// false
// >>> check_dict_case(map[string]string{"STATE": "NC", "ZIP": "12345"})
// true
func check_dict_case(dict map[string]string) bool {

func TestCheck_Dict_Case(t *testing.T) {
  candidate := check_dict_case
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(map[string]string{"p": "pineapple", "b": "banana"}), expected: true },
     { actual: candidate(map[string]string{"p": "pineapple", "A": "banana", "B": "banana"}), expected: false },
     { actual: candidate(map[string]string{"p": "pineapple", "5": "banana", "a": "apple"}), expected: false },
     { actual: candidate(map[string]string{"Name": "John", "Age": "36", "City": "Houston"}), expected: false },
     { actual: candidate(map[string]string{"STATE": "NC", "ZIP": "12345"}), expected: true },
     { actual: candidate(map[string]string{"fruit": "Orange", "taste": "Sweet"}), expected: true },
     { actual: candidate(map[string]string{}), expected: false },
   }

	for i, tc := range tests {
		t.Run(fmt.Sprintf("test num % d", i), func(t *testing.T) {
			if fmt.Sprintf("%v", tc.actual) != fmt.Sprintf("%v", tc.expected) {
				t.Errorf("expected '%s', got '%s'", tc.expected, tc.actual)
			}
		})
	}
}


Prompt:
package count_up_to_test

import (
    "testing"
    "fmt"
)

// Implement a function that takes an non-negative integer and returns an array of the first n
// integers that are prime numbers and less than n.
// for example:
// >>> count_up_to(5)
// []int{2, 3}
// >>> count_up_to(11)
// []int{2, 3, 5, 7}
// >>> count_up_to(0)
// []int{}
// >>> count_up_to(20)
// []int{2, 3, 5, 7, 11, 13, 17, 19}
// >>> count_up_to(1)
// []int{}
// >>> count_up_to(18)
// []int{2, 3, 5, 7, 11, 13, 17}
func count_up_to(n int) []int {

func TestCount_Up_To(t *testing.T) {
  candidate := count_up_to
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(5), expected: []int{2, 3} },
     { actual: candidate(6), expected: []int{2, 3, 5} },
     { actual: candidate(7), expected: []int{2, 3, 5} },
     { actual: candidate(10), expected: []int{2, 3, 5, 7} },
     { actual: candidate(0), expected: []int{} },
     { actual: candidate(22), expected: []int{2, 3, 5, 7, 11, 13, 17, 19} },
     { actual: candidate(1), expected: []int{} },
     { actual: candidate(18), expected: []int{2, 3, 5, 7, 11, 13, 17} },
     { actual: candidate(47), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43} },
     { actual: candidate(101), expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} },
   }

	for i, tc := range tests {
		t.Run(fmt.Sprintf("test num % d", i), func(t *testing.T) {
			if fmt.Sprintf("%v", tc.actual) != fmt.Sprintf("%v", tc.expected) {
				t.Errorf("expected '%s', got '%s'", tc.expected, tc.actual)
			}
		})
	}
}


Prompt:
package multiply_test

import (
    "testing"
    "fmt"
)

// Complete the function that takes two integers and returns
// the product of their unit digits.
// Assume the input is always valid.
// Examples:
// >>> multiply(148, 412)
// 16
// >>> multiply(19, 28)
// 72
// >>> multiply(2020, 1851)
// 0
// >>> multiply(14, -15)
// 20
func multiply(a int, b int) int {

func TestMultiply(t *testing.T) {
  candidate := multiply
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(148, 412), expected: 16 },
     { actual: candidate(19, 28), expected: 72 },
     { actual: candidate(2020, 1851), expected: 0 },
     { actual: candidate(14, -15), expected: 20 },
     { actual: candidate(76, 67), expected: 42 },
     { actual: candidate(17, 27), expected: 49 },
     { actual: candidate(0, 1), expected: 0 },
     { actual: candidate(0, 0), expected: 0 },
   }

	for i, tc := range tests {
		t.Run(fmt.Sprintf("test num % d", i), func(t *testing.T) {
			if fmt.Sprintf("%v", tc.actual) != fmt.Sprintf("%v", tc.expected) {
				t.Errorf("expected '%s', got '%s'", tc.expected, tc.actual)
			}
		})
	}
}


Prompt:
package count_upper_test

import (
    "testing"
    "fmt"
)

// Given a string s, count the number of uppercase vowels in even indices.
// For example:
// >>> count_upper("aBCdEf")
// 1
// >>> count_upper("abcdefg")
// 0
// >>> count_upper("dBBE")
// 0
func count_upper(s string) int {

func TestCount_Upper(t *testing.T) {
  candidate := count_upper
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("aBCdEf"), expected: 1 },
     { actual: candidate("abcdefg"), expected: 0 },
     { actual: candidate("dBBE"), expected: 0 },
     { actual: candidate("B"), expected: 0 },
     { actual: candidate("U"), expected: 1 },
     { actual: candidate(""), expected: 0 },
     { actual: candidate("EEEE"), expected: 2 },
   }

	for i, tc := range tests {
		t.Run(fmt.Sprintf("test num % d", i), func(t *testing.T) {
			if fmt.Sprintf("%v", tc.actual) != fmt.Sprintf("%v", tc.expected) {
				t.Errorf("expected '%s', got '%s'", tc.expected, tc.actual)
			}
		})
	}
}


Prompt:
package closest_integer_test

import (
    "testing"
    "fmt"
)

// Create a function that takes a value (string) representing a number
// and returns the closest integer to it. If the number is equidistant
// from two integers, round it away from zero.
// Examples
// >>> closest_integer("10")
// 10
// >>> closest_integer("15.3")
// 15
// Note:
// Rounding away from zero means that if the given number is equidistant
// from two integers, the one you should return is the one that is the
// farthest from zero. For example closest_integer("14.5") should
// return 15 and closest_integer("-14.5") should return -15.
func closest_integer(value string) int {

func TestClosest_Integer(t *testing.T) {
  candidate := closest_integer
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("10"), expected: 10 },
     { actual: candidate("14.5"), expected: 15 },
     { actual: candidate("-15.5"), expected: -16 },
     { actual: candidate("15.3"), expected: 15 },
     { actual: candidate("0"), expected: 0 },
   }

	for i, tc := range tests {
		t.Run(fmt.Sprintf("test num % d", i), func(t *testing.T) {
			if fmt.Sprintf("%v", tc.actual) != fmt.Sprintf("%v", tc.expected) {
				t.Errorf("expected '%s', got '%s'", tc.expected, tc.actual)
			}
		})
	}
}


Prompt:
package rolling_max_test

import (
    "testing"
    "fmt"
)

// From a given list of integers, generate a list of rolling maximum element found until given moment
// in the sequence.
// >>> rolling_max([]int{1, 2, 3, 2, 3, 4, 2})
// []int{1, 2, 3, 3, 3, 4, 4}
func rolling_max(numbers []int) []int {

func TestRolling_Max(t *testing.T) {
  candidate := rolling_max
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{}), expected: []int{} },
     { actual: candidate([]int{1, 2, 3, 4}), expected: []int{1, 2, 3, 4} },
     { actual: candidate([]int{4, 3, 2, 1}), expected: []int{4, 4, 4, 4} },
     { actual: candidate([]int{3, 2, 3, 100, 3}), expected: []int{3, 3, 3, 100, 100} },
   }

	for i, tc := range tests {
		t.Run(fmt.Sprintf("test num % d", i), func(t *testing.T) {
			if fmt.Sprintf("%v", tc.actual) != fmt.Sprintf("%v", tc.expected) {
				t.Errorf("expected '%s', got '%s'", tc.expected, tc.actual)
			}
		})
	}
}