Prompt:
package digitSum_test

import (
    "testing"
    "fmt"
)

// Task
// Write a function that takes a string as input and returns the sum of the upper characters only'
// ASCII codes.
// Examples:
// >>> digitSum("")
// 0
// >>> digitSum("abAB")
// 131
// >>> digitSum("abcCd")
// 67
// >>> digitSum("helloE")
// 69
// >>> digitSum("woArBld")
// 131
// >>> digitSum("aAaaaXa")
// 153
func digitSum(s string) int {

func TestDigitsum(t *testing.T) {
  candidate := digitSum
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(""), expected: 0 },
     { actual: candidate("abAB"), expected: 131 },
     { actual: candidate("abcCd"), expected: 67 },
     { actual: candidate("helloE"), expected: 69 },
     { actual: candidate("woArBld"), expected: 131 },
     { actual: candidate("aAaaaXa"), expected: 153 },
     { actual: candidate(" How are yOu?"), expected: 151 },
     { actual: candidate("You arE Very Smart"), expected: 327 },
   }

	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 rescale_to_unit_test

import (
    "testing"
    "fmt"
)

// Given list of numbers (of at least two elements), apply a linear transform to that list,
// such that the smallest number will become 0 and the largest will become 1
// >>> rescale_to_unit([]float64{1.0, 2.0, 3.0, 4.0, 5.0})
// []float64{0.0, 0.25, 0.5, 0.75, 1.0}
func rescale_to_unit(numbers []float64) []float64 {

func TestRescale_To_Unit(t *testing.T) {
  candidate := rescale_to_unit
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]float64{2.0, 49.9}), expected: []float64{0.0, 1.0} },
     { actual: candidate([]float64{100.0, 49.9}), expected: []float64{1.0, 0.0} },
     { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: []float64{0.0, 0.25, 0.5, 0.75, 1.0} },
     { actual: candidate([]float64{2.0, 1.0, 5.0, 3.0, 4.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },
     { actual: candidate([]float64{12.0, 11.0, 15.0, 13.0, 14.0}), expected: []float64{0.25, 0.0, 1.0, 0.5, 0.75} },
   }

	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 solution_test

import (
    "testing"
    "fmt"
)

// Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.
// Examples
// >>> solution([]int{5, 8, 7, 1})
// 12
// >>> solution([]int{3, 3, 3, 3, 3})
// 9
// >>> solution([]int{30, 13, 24, 321})
// 0
func solution(lst []int) int {

func TestSolution(t *testing.T) {
  candidate := solution
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{5, 8, 7, 1}), expected: 12 },
     { actual: candidate([]int{3, 3, 3, 3, 3}), expected: 9 },
     { actual: candidate([]int{30, 13, 24, 321}), expected: 0 },
     { actual: candidate([]int{5, 9}), expected: 5 },
     { actual: candidate([]int{2, 4, 8}), expected: 0 },
     { actual: candidate([]int{30, 13, 23, 32}), expected: 23 },
     { actual: candidate([]int{3, 13, 2, 9}), expected: 3 },
   }

	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 pluck_test

import (
    "testing"
    "fmt"
)

// "Given a list representing a branch of a tree that has non-negative integer nodes
// your task is to pluck one of the nodes and return it.
// The plucked node should be the node with the smallest even value.
// If multiple nodes with the same smallest even value are found return the node that has smallest index.
// The plucked node should be returned in a list, [ smalest_value, its index ],
// If there are no even values or the given list is empty, return [].
// Example 1:
// >>> pluck([]int{4, 2, 3})
// []int{2, 1}
// Explanation: 2 has the smallest even value, and 2 has the smallest index.
// Example 2:
// >>> pluck([]int{1, 2, 3})
// []int{2, 1}
// Explanation: 2 has the smallest even value, and 2 has the smallest index.
// Example 3:
// >>> pluck([]int{})
// []int{}
// Example 4:
// >>> pluck([]int{5, 0, 3, 0, 4, 2})
// []int{0, 1}
// Explanation: 0 is the smallest value, but  there are two zeros,
// so we will choose the first zero, which has the smallest index.
// Constraints:
// * 1 <= nodes.length <= 10000
// * 0 <= node.value
func pluck(arr []int) []int {

func TestPluck(t *testing.T) {
  candidate := pluck
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{4, 2, 3}), expected: []int{2, 1} },
     { actual: candidate([]int{1, 2, 3}), expected: []int{2, 1} },
     { actual: candidate([]int{}), expected: []int{} },
     { actual: candidate([]int{5, 0, 3, 0, 4, 2}), expected: []int{0, 1} },
     { actual: candidate([]int{1, 2, 3, 0, 5, 3}), expected: []int{0, 3} },
     { actual: candidate([]int{5, 4, 8, 4, 8}), expected: []int{4, 1} },
     { actual: candidate([]int{7, 6, 7, 1}), expected: []int{6, 1} },
     { actual: candidate([]int{7, 9, 7, 1}), expected: []int{} },
   }

	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 get_max_triples_test

import (
    "testing"
    "fmt"
)

// You are given a positive integer n. You have to create an integer list a of length n.
// For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.
// Return the number of triples (a[i], a[j], a[k]) of a where i < j < k,
// and a[i] + a[j] + a[k] is a multiple of 3.
// Example :
// >>> get_max_triples(5)
// 1
// Explanation:
// a = [1, 3, 7, 13, 21]
// The only valid triple is (1, 7, 13).
func get_max_triples(n int) int {

func TestGet_Max_Triples(t *testing.T) {
  candidate := get_max_triples
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(5), expected: 1 },
     { actual: candidate(6), expected: 4 },
     { actual: candidate(10), expected: 36 },
     { actual: candidate(100), expected: 53361 },
   }

	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 exchange_test

import (
    "testing"
    "fmt"
)

// In this problem, you will implement a function that takes two lists of numbers,
// and determines whether it is possible to perform an exchange of elements
// between them to make lst1 a list of only even numbers.
// There is no limit on the number of exchanged elements between lst1 and lst2.
// If it is possible to exchange elements between the lst1 and lst2 to make
// all the elements of lst1 to be even, return "YES".
// Otherwise, return "NO".
// For example:
// >>> exchange([]int{1, 2, 3, 4}, []int{1, 2, 3, 4})
// "YES"
// >>> exchange([]int{1, 2, 3, 4}, []int{1, 5, 3, 4})
// "NO"
// It is assumed that the input lists will be non-empty.
func exchange(lst1 []int, lst2 []int) string {

func TestExchange(t *testing.T) {
  candidate := exchange
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 3, 4}, []int{1, 2, 3, 4}), expected: "YES" },
     { actual: candidate([]int{1, 2, 3, 4}, []int{1, 5, 3, 4}), expected: "NO" },
     { actual: candidate([]int{1, 2, 3, 4}, []int{2, 1, 4, 3}), expected: "YES" },
     { actual: candidate([]int{5, 7, 3}, []int{2, 6, 4}), expected: "YES" },
     { actual: candidate([]int{5, 7, 3}, []int{2, 6, 3}), expected: "NO" },
     { actual: candidate([]int{3, 2, 6, 1, 8, 9}, []int{3, 5, 5, 1, 1, 1}), expected: "NO" },
     { actual: candidate([]int{100, 200}, []int{200, 200}), expected: "YES" },
   }

	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 median_test

import (
    "testing"
    "fmt"
)

// Return median of elements in the list l.
// >>> median([]int{3, 1, 2, 4, 5})
// 3
// >>> median([]int{-10, 4, 6, 1000, 10, 20})
// 15.0
func median(l []int) float64 {

func TestMedian(t *testing.T) {
  candidate := median
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{3, 1, 2, 4, 5}), expected: 3 },
     { actual: candidate([]int{-10, 4, 6, 1000, 10, 20}), expected: 8.0 },
     { actual: candidate([]int{5}), expected: 5 },
     { actual: candidate([]int{6, 5}), expected: 5.5 },
     { actual: candidate([]int{8, 1, 3, 9, 9, 2, 7}), expected: 7 },
   }

	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 prime_length_test

import (
    "testing"
    "fmt"
)

// Write a function that takes a string and returns true if the string
// length is a prime number or false otherwise
// Examples
// >>> prime_length("Hello")
// true
// >>> prime_length("abcdcba")
// true
// >>> prime_length("kittens")
// true
// >>> prime_length("orange")
// false
func prime_length(myString string) bool {

func TestPrime_Length(t *testing.T) {
  candidate := prime_length
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("Hello"), expected: true },
     { actual: candidate("abcdcba"), expected: true },
     { actual: candidate("kittens"), expected: true },
     { actual: candidate("orange"), expected: false },
     { actual: candidate("wow"), expected: true },
     { actual: candidate("world"), expected: true },
     { actual: candidate("MadaM"), expected: true },
     { actual: candidate("Wow"), expected: true },
     { actual: candidate(""), expected: false },
     { actual: candidate("HI"), expected: true },
     { actual: candidate("go"), expected: true },
     { actual: candidate("gogo"), expected: false },
     { actual: candidate("aaaaaaaaaaaaaaa"), expected: false },
     { actual: candidate("Madam"), expected: true },
     { actual: candidate("M"), expected: false },
     { actual: candidate("0"), 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 smallest_change_test

import (
    "testing"
    "fmt"
)

// Given a list arr of integers, find the minimum number of elements that
// need to be changed to make the list palindromic. A palindromic list is a list that
// is read the same backwards and forwards. In one change, you can change one element to any other element.
// For example:
// >>> smallest_change([]int{1, 2, 3, 5, 4, 7, 9, 6})
// 4
// >>> smallest_change([]int{1, 2, 3, 4, 3, 2, 2})
// 1
// >>> smallest_change([]int{1, 2, 3, 2, 1})
// 0
func smallest_change(arr []int) int {

func TestSmallest_Change(t *testing.T) {
  candidate := smallest_change
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 3, 5, 4, 7, 9, 6}), expected: 4 },
     { actual: candidate([]int{1, 2, 3, 4, 3, 2, 2}), expected: 1 },
     { actual: candidate([]int{1, 4, 2}), expected: 1 },
     { actual: candidate([]int{1, 4, 4, 2}), expected: 1 },
     { actual: candidate([]int{1, 2, 3, 2, 1}), expected: 0 },
     { actual: candidate([]int{3, 1, 1, 3}), expected: 0 },
     { actual: candidate([]int{1}), expected: 0 },
     { actual: candidate([]int{0, 1}), expected: 1 },
   }

	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 sum_squares_test

import (
    "testing"
    "fmt"
)

// You are given a list of numbers.
// You need to return the sum of squared numbers in the given list,
// round each element in the list to the upper int(Ceiling) first.
// Examples:
// >>> lst([]float64{1.0, 2.0, 3.0})
// 14
// >>> lst([]float64{1.0, 4.0, 9.0})
// 98
// >>> lst([]float64{1.0, 3.0, 5.0, 7.0})
// 84
// >>> lst([]float64{1.4, 4.2, 0.0})
// 29
// >>> lst([]float64{-2.4, 1.0, 1.0})
// 6
func sum_squares(lst []float64) int {

func TestSum_Squares(t *testing.T) {
  candidate := sum_squares
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },
     { actual: candidate([]float64{1.0, 2.0, 3.0}), expected: 14 },
     { actual: candidate([]float64{1.0, 3.0, 5.0, 7.0}), expected: 84 },
     { actual: candidate([]float64{1.4, 4.2, 0.0}), expected: 29 },
     { actual: candidate([]float64{-2.4, 1.0, 1.0}), expected: 6 },
     { actual: candidate([]float64{100.0, 1.0, 15.0, 2.0}), expected: 10230 },
     { actual: candidate([]float64{10000.0, 10000.0}), expected: 200000000 },
     { actual: candidate([]float64{-1.4, 4.6, 6.3}), expected: 75 },
     { actual: candidate([]float64{-1.4, 17.9, 18.9, 19.9}), expected: 1086 },
     { actual: candidate([]float64{0.0}), expected: 0 },
     { actual: candidate([]float64{-1.0}), expected: 1 },
     { actual: candidate([]float64{-1.0, 1.0, 0.0}), 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 file_name_check_test

import (
    "testing"
    "fmt"
)

// Create a function which takes a string representing a file's name, and returns
// 'Yes' if the the file's name is valid, and returns 'No' otherwise.
// A file's name is considered to be valid if and only if all the following conditions
// are met:
// - There should not be more than three digits ('0'-'9') in the file's name.
// - The file's name contains exactly one dot '.'
// - The substring before the dot should not be empty, and it starts with a letter from
// the latin alphapet ('a'-'z' and 'A'-'Z').
// - The substring after the dot should be one of these: ['txt', 'exe', 'dll']
// Examples:
// >>> file_name_check("example.txt")
// "Yes"
// >>> file_name_check("1example.dll")
// "No"
func file_name_check(file_name string) string {

func TestFile_Name_Check(t *testing.T) {
  candidate := file_name_check
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("example.txt"), expected: "Yes" },
     { actual: candidate("1example.dll"), expected: "No" },
     { actual: candidate("s1sdf3.asd"), expected: "No" },
     { actual: candidate("K.dll"), expected: "Yes" },
     { actual: candidate("MY16FILE3.exe"), expected: "Yes" },
     { actual: candidate("His12FILE94.exe"), expected: "No" },
     { actual: candidate("_Y.txt"), expected: "No" },
     { actual: candidate("?aREYA.exe"), expected: "No" },
     { actual: candidate("/this_is_valid.dll"), expected: "No" },
     { actual: candidate("this_is_valid.wow"), expected: "No" },
     { actual: candidate("this_is_valid.txt"), expected: "Yes" },
     { actual: candidate("this_is_valid.txtexe"), expected: "No" },
     { actual: candidate("#this2_i4s_5valid.ten"), expected: "No" },
     { actual: candidate("@this1_is6_valid.exe"), expected: "No" },
     { actual: candidate("this_is_12valid.6exe4.txt"), expected: "No" },
     { actual: candidate("all.exe.txt"), expected: "No" },
     { actual: candidate("I563_No.exe"), expected: "Yes" },
     { actual: candidate("Is3youfault.txt"), expected: "Yes" },
     { actual: candidate("no_one#knows.dll"), expected: "Yes" },
     { actual: candidate("1I563_Yes3.exe"), expected: "No" },
     { actual: candidate("I563_Yes3.txtt"), expected: "No" },
     { actual: candidate("final..txt"), expected: "No" },
     { actual: candidate("final132"), expected: "No" },
     { actual: candidate("_f4indsartal132."), expected: "No" },
     { actual: candidate(".txt"), expected: "No" },
     { actual: candidate("s."), expected: "No" },
   }

	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 triples_sum_to_zero_test

import (
    "testing"
    "fmt"
)

// triples_sum_to_zero takes a list of integers as an input.
// it returns true if there are three distinct elements in the list that
// sum to zero, and false otherwise.
// >>> triples_sum_to_zero([]int{1, 3, 5, 0})
// false
// >>> triples_sum_to_zero([]int{1, 3, -2, 1})
// true
// >>> triples_sum_to_zero([]int{1, 2, 3, 7})
// false
// >>> triples_sum_to_zero([]int{2, 4, -5, 3, 9, 7})
// true
// >>> triples_sum_to_zero([]int{1})
// false
func triples_sum_to_zero(l []int) bool {

func TestTriples_Sum_To_Zero(t *testing.T) {
  candidate := triples_sum_to_zero
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 3, 5, 0}), expected: false },
     { actual: candidate([]int{1, 3, 5, -1}), expected: false },
     { actual: candidate([]int{1, 3, -2, 1}), expected: true },
     { actual: candidate([]int{1, 2, 3, 7}), expected: false },
     { actual: candidate([]int{1, 2, 5, 7}), expected: false },
     { actual: candidate([]int{2, 4, -5, 3, 9, 7}), expected: true },
     { actual: candidate([]int{1}), expected: false },
     { actual: candidate([]int{1, 3, 5, -100}), expected: false },
     { actual: candidate([]int{100, 3, 5, -100}), 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 intersection_test

import (
    "testing"
    "fmt"
)

// You are given two intervals,
// where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).
// The given intervals are closed which means that the interval (start, end)
// includes both start and end.
// For each given interval, it is assumed that its start is less or equal its end.
// Your task is to determine whether the length of intersection of these two
// intervals is a prime number.
// Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)
// which its length is 1, which not a prime number.
// If the length of the intersection is a prime number, return "YES",
// otherwise, return "NO".
// If the two intervals don't intersect, return "NO".
// [input/output] samples:
// >>> intersection([]interface{}{1, 2}, []interface{}{2, 3})
// "NO"
// >>> intersection([]interface{}{-1, 1}, []interface{}{0, 4})
// "NO"
// >>> intersection([]interface{}{-3, -1}, []interface{}{-5, 5})
// "YES"
func intersection(interval1 []interface{}, interval2 []interface{}) string {

func TestIntersection(t *testing.T) {
  candidate := intersection
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]interface{}{1, 2}, []interface{}{2, 3}), expected: "NO" },
     { actual: candidate([]interface{}{-1, 1}, []interface{}{0, 4}), expected: "NO" },
     { actual: candidate([]interface{}{-3, -1}, []interface{}{-5, 5}), expected: "YES" },
     { actual: candidate([]interface{}{-2, 2}, []interface{}{-4, 0}), expected: "YES" },
     { actual: candidate([]interface{}{-11, 2}, []interface{}{-1, -1}), expected: "NO" },
     { actual: candidate([]interface{}{1, 2}, []interface{}{3, 5}), expected: "NO" },
     { actual: candidate([]interface{}{1, 2}, []interface{}{1, 2}), expected: "NO" },
     { actual: candidate([]interface{}{-2, -2}, []interface{}{-3, -2}), expected: "NO" },
   }

	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 separate_paren_groups_test

import (
    "testing"
    "fmt"
)

// Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
// separate those group into separate strings and return the list of those.
// Separate groups are balanced (each open brace is properly closed) and not nested within each other
// Ignore any spaces in the input string.
// >>> separate_paren_groups("( ) (( )) (( )( ))")
// []string{"()", "(())", "(()())"}
func separate_paren_groups(paren_string string) []string {

func TestSeparate_Paren_Groups(t *testing.T) {
  candidate := separate_paren_groups
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("(()()) ((())) () ((())()())"), expected: []string{"(()())", "((()))", "()", "((())()())"} },
     { actual: candidate("() (()) ((())) (((())))"), expected: []string{"()", "(())", "((()))", "(((())))"} },
     { actual: candidate("(()(())((())))"), expected: []string{"(()(())((())))"} },
     { actual: candidate("( ) (( )) (( )( ))"), expected: []string{"()", "(())", "(()())"} },
   }

	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 compare_test

import (
    "testing"
    "fmt"
)

// I think we all remember that feeling when the result of some long-awaited
// event is finally known. The feelings and thoughts you have at that moment are
// definitely worth noting down and comparing.
// Your task is to determine if a person correctly guessed the results of a number of matches.
// You are given two lists of scores and guesses of equal length, where each index shows a match.
// Return a list of the same length denoting how far off each guess was. If they have guessed correctly,
// the value is 0, and if not, the value is the absolute difference between the guess and the score.
// example:
// >>> compare([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2})
// []int{0, 0, 0, 0, 3, 3}
// >>> compare([]int{0, 5, 0, 0, 0, 4}, []int{4, 1, 1, 0, 0, -2})
// []int{4, 4, 1, 0, 0, 6}
func compare(game []int, guess []int) []int {

func TestCompare(t *testing.T) {
  candidate := compare
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 3, 4, 5, 1}, []int{1, 2, 3, 4, 2, -2}), expected: []int{0, 0, 0, 0, 3, 3} },
     { actual: candidate([]int{0, 0, 0, 0, 0, 0}, []int{0, 0, 0, 0, 0, 0}), expected: []int{0, 0, 0, 0, 0, 0} },
     { actual: candidate([]int{1, 2, 3}, []int{-1, -2, -3}), expected: []int{2, 4, 6} },
     { actual: candidate([]int{1, 2, 3, 5}, []int{-1, 2, 3, 4}), expected: []int{2, 0, 0, 1} },
   }

	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 starts_one_ends_test

import (
    "testing"
    "fmt"
)

// Given a positive integer n, return the count of the numbers of n-digit
// positive integers that start or end with 1.
func starts_one_ends(n int) int {

func TestStarts_One_Ends(t *testing.T) {
  candidate := starts_one_ends
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(1), expected: 1 },
     { actual: candidate(2), expected: 18 },
     { actual: candidate(3), expected: 180 },
     { actual: candidate(4), expected: 1800 },
     { actual: candidate(5), expected: 18000 },
   }

	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 check_if_last_char_is_a_letter_test

import (
    "testing"
    "fmt"
)

// Create a function that returns true if the last character
// of a given string is an alphabetical character and is not
// a part of a word, and false otherwise.
// Note: "word" is a group of characters separated by space.
// Examples:
// >>> check_if_last_char_is_a_letter("apple pie")
// false
// >>> check_if_last_char_is_a_letter("apple pi e")
// true
// >>> check_if_last_char_is_a_letter("apple pi e ")
// false
// >>> check_if_last_char_is_a_letter("")
// false
func check_if_last_char_is_a_letter(txt string) bool {

func TestCheck_If_Last_Char_Is_A_Letter(t *testing.T) {
  candidate := check_if_last_char_is_a_letter
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("apple"), expected: false },
     { actual: candidate("apple pi e"), expected: true },
     { actual: candidate("eeeee"), expected: false },
     { actual: candidate("A"), expected: true },
     { actual: candidate("Pumpkin pie "), expected: false },
     { actual: candidate("Pumpkin pie 1"), expected: false },
     { actual: candidate(""), expected: false },
     { actual: candidate("eeeee e "), expected: false },
     { actual: candidate("apple pie"), expected: false },
     { actual: candidate("apple pi e "), 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 valid_date_test

import (
    "testing"
    "fmt"
)

// You have to write a function which validates a given date string and
// returns true if the date is valid otherwise false.
// The date is valid if all of the following rules are satisfied:
// 1. The date string is not empty.
// 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.
// 3. The months should not be less than 1 or higher than 12.
// 4. The date should be in the format: mm-dd-yyyy
// >>> valid_date("03-11-2000")
// true
// >>> valid_date("15-01-2012")
// false
// >>> valid_date("04-0-2040")
// false
// >>> valid_date("06-04-2020")
// true
// >>> valid_date("06/04/2020")
// false
func valid_date(date string) bool {

func TestValid_Date(t *testing.T) {
  candidate := valid_date
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("03-11-2000"), expected: true },
     { actual: candidate("15-01-2012"), expected: false },
     { actual: candidate("04-0-2040"), expected: false },
     { actual: candidate("06-04-2020"), expected: true },
     { actual: candidate("01-01-2007"), expected: true },
     { actual: candidate("03-32-2011"), expected: false },
     { actual: candidate(""), expected: false },
     { actual: candidate("04-31-3000"), expected: false },
     { actual: candidate("06-06-2005"), expected: true },
     { actual: candidate("21-31-2000"), expected: false },
     { actual: candidate("04-12-2003"), expected: true },
     { actual: candidate("04122003"), expected: false },
     { actual: candidate("20030412"), expected: false },
     { actual: candidate("2003-04"), expected: false },
     { actual: candidate("2003-04-12"), expected: false },
     { actual: candidate("04-2003"), 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_nums_test

import (
    "testing"
    "fmt"
)

// Write a function count_nums which takes a list of integers and returns
// the number of elements which has a sum of digits > 0.
// If a number is negative, then its first signed digit will be negative:
// e.g. -123 has signed digits -1, 2, and 3.
// >>> count_nums([]int{})
// 0
// >>> count_nums([]int{-1, 11, -11})
// 1
// >>> count_nums([]int{1, 1, 2})
// 3
func count_nums(arr []int) int {

func TestCount_Nums(t *testing.T) {
  candidate := count_nums
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{}), expected: 0 },
     { actual: candidate([]int{-1, -2, 0}), expected: 0 },
     { actual: candidate([]int{1, 1, 2, -2, 3, 4, 5}), expected: 6 },
     { actual: candidate([]int{1, 6, 9, -6, 0, 1, 5}), expected: 5 },
     { actual: candidate([]int{1, 100, 98, -7, 1, -1}), expected: 4 },
     { actual: candidate([]int{12, 23, 34, -45, -56, 0}), expected: 5 },
     { actual: candidate([]int{0, 1}), expected: 1 },
     { actual: candidate([]int{1}), expected: 1 },
   }

	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 anti_shuffle_test

import (
    "testing"
    "fmt"
)

// Write a function that takes a string and returns an ordered version of it.
// Ordered version of string, is a string where all words (separated by space)
// are replaced by a new word where all the characters arranged in
// ascending order based on ascii value.
// Note: You should keep the order of words and blank spaces in the sentence.
// For example:
// >>> anti_shuffle("Hi")
// "Hi"
// >>> anti_shuffle("hello")
// "ehllo"
// >>> anti_shuffle("Hello World!!!")
// "Hello !!!Wdlor"
func anti_shuffle(s string) string {

func TestAnti_Shuffle(t *testing.T) {
  candidate := anti_shuffle
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("Hi"), expected: "Hi" },
     { actual: candidate("hello"), expected: "ehllo" },
     { actual: candidate("number"), expected: "bemnru" },
     { actual: candidate("abcd"), expected: "abcd" },
     { actual: candidate("Hello World!!!"), expected: "Hello !!!Wdlor" },
     { actual: candidate(""), expected: "" },
     { actual: candidate("Hi. My name is Mister Robot. How are you?"), expected: ".Hi My aemn is Meirst .Rboot How aer ?ouy" },
   }

	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 is_palindrome_test

import (
    "testing"
    "fmt"
)

// Checks if given string is a palindrome
// >>> is_palindrome("")
// true
// >>> is_palindrome("aba")
// true
// >>> is_palindrome("aaaaa")
// true
// >>> is_palindrome("zbcd")
// false
func is_palindrome(text string) bool {

func TestIs_Palindrome(t *testing.T) {
  candidate := is_palindrome
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(""), expected: true },
     { actual: candidate("aba"), expected: true },
     { actual: candidate("aaaaa"), expected: true },
     { actual: candidate("zbcd"), expected: false },
     { actual: candidate("xywyx"), expected: true },
     { actual: candidate("xywyz"), expected: false },
     { actual: candidate("xywzx"), 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 get_closest_vowel_test

import (
    "testing"
    "fmt"
)

// You are given a word. Your task is to find the closest vowel that stands between
// two consonants from the right side of the word (case sensitive).
// Vowels in the beginning and ending doesn't count. Return empty string if you didn't
// find any vowel met the above condition.
// You may assume that the given string contains English letter only.
// Example:
// >>> get_closest_vowel("yogurt")
// "u"
// >>> get_closest_vowel("FULL")
// "U"
// >>> get_closest_vowel("quick")
// ""
// >>> get_closest_vowel("ab")
// ""
func get_closest_vowel(word string) string {

func TestGet_Closest_Vowel(t *testing.T) {
  candidate := get_closest_vowel
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("yogurt"), expected: "u" },
     { actual: candidate("full"), expected: "u" },
     { actual: candidate("easy"), expected: "" },
     { actual: candidate("eAsy"), expected: "" },
     { actual: candidate("ali"), expected: "" },
     { actual: candidate("bad"), expected: "a" },
     { actual: candidate("most"), expected: "o" },
     { actual: candidate("ab"), expected: "" },
     { actual: candidate("ba"), expected: "" },
     { actual: candidate("quick"), expected: "" },
     { actual: candidate("anime"), expected: "i" },
     { actual: candidate("Asia"), expected: "" },
     { actual: candidate("Above"), expected: "o" },
   }

	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 is_prime_test

import (
    "testing"
    "fmt"
)

// Return true if a given number is prime, and false otherwise.
// >>> is_prime(6)
// false
// >>> is_prime(101)
// true
// >>> is_prime(11)
// true
// >>> is_prime(13441)
// true
// >>> is_prime(61)
// true
// >>> is_prime(4)
// false
// >>> is_prime(1)
// false
func is_prime(n int) bool {

func TestIs_Prime(t *testing.T) {
  candidate := is_prime
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(6), expected: false },
     { actual: candidate(101), expected: true },
     { actual: candidate(11), expected: true },
     { actual: candidate(13441), expected: true },
     { actual: candidate(61), expected: true },
     { actual: candidate(4), expected: false },
     { actual: candidate(1), expected: false },
     { actual: candidate(5), expected: true },
     { actual: candidate(11), expected: true },
     { actual: candidate(17), expected: true },
     { actual: candidate(85), expected: false },
     { actual: candidate(77), expected: false },
     { actual: candidate(255379), 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 simplify_test

import (
    "testing"
    "fmt"
)

// Your task is to implement a function that will simplify the expression
// x * n. The function returns true if x * n evaluates to a whole number and false
// otherwise. Both x and n, are string representation of a fraction, and have the following format,
// <numerator>/<denominator> where both numerator and denominator are positive whole numbers.
// You can assume that x, and n are valid fractions, and do not have zero as denominator.
// >>> simplify("1/5", "5/1")
// true
// >>> simplify("1/6", "2/1")
// false
// >>> simplify("7/10", "10/2")
// false
func simplify(x string, n string) bool {

func TestSimplify(t *testing.T) {
  candidate := simplify
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("1/5", "5/1"), expected: true },
     { actual: candidate("1/6", "2/1"), expected: false },
     { actual: candidate("5/1", "3/1"), expected: true },
     { actual: candidate("7/10", "10/2"), expected: false },
     { actual: candidate("2/10", "50/10"), expected: true },
     { actual: candidate("7/2", "4/2"), expected: true },
     { actual: candidate("11/6", "6/1"), expected: true },
     { actual: candidate("2/3", "5/2"), expected: false },
     { actual: candidate("5/2", "3/5"), expected: false },
     { actual: candidate("2/4", "8/4"), expected: true },
     { actual: candidate("2/4", "4/2"), expected: true },
     { actual: candidate("1/5", "5/1"), expected: true },
     { actual: candidate("1/5", "1/5"), 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 hex_key_test

import (
    "testing"
    "fmt"
)

// You have been tasked to write a function that receives
// a hexadecimal number as a string and counts the number of hexadecimal
// digits that are primes (prime number, or a prime, is a natural number
// greater than 1 that is not a product of two smaller natural numbers).
// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
// So you have to determine a number of the following digits: 2, 3, 5, 7,
// B (=decimal 11), D (=decimal 13).
// Note: you may assume the input is always correct or empty string,
// and symbols A,B,C,D,E,F are always uppercase.
// Examples:
// >>> hex_key("AB")
// 1
// >>> hex_key("1077E")
// 2
// >>> hex_key("ABED1A33")
// 4
// >>> hex_key("123456789ABCDEF0")
// 6
// >>> hex_key("2020")
// 2
func hex_key(num string) int {

func TestHex_Key(t *testing.T) {
  candidate := hex_key
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("AB"), expected: 1 },
     { actual: candidate("1077E"), expected: 2 },
     { actual: candidate("ABED1A33"), expected: 4 },
     { actual: candidate("2020"), expected: 2 },
     { actual: candidate("123456789ABCDEF0"), expected: 6 },
     { actual: candidate("112233445566778899AABBCCDDEEFF00"), expected: 12 },
   }

	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 words_in_sentence_test

import (
    "testing"
    "fmt"
)

// You are given a string representing a sentence,
// the sentence contains some words separated by a space,
// and you have to return a string that contains the words from the original sentence,
// whose lengths are prime numbers,
// the order of the words in the new string should be the same as the original one.
// Example 1:
// >>> words_in_sentence("This is a test")
// "is"
// Example 2:
// >>> words_in_sentence("lets go for swimming")
// "go for"
// Constraints:
// * 1 <= len(sentence) <= 100
// * sentence contains only letters
func words_in_sentence(sentence string) string {

func TestWords_In_Sentence(t *testing.T) {
  candidate := words_in_sentence
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("This is a test"), expected: "is" },
     { actual: candidate("lets go for swimming"), expected: "go for" },
     { actual: candidate("there is no place available here"), expected: "there is no place" },
     { actual: candidate("Hi I am Hussein"), expected: "Hi am Hussein" },
     { actual: candidate("go for it"), expected: "go for it" },
     { actual: candidate("here"), expected: "" },
     { actual: candidate("here is"), expected: "is" },
   }

	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 histogram_test

import (
    "testing"
    "fmt"
)

// Given a string representing a space separated lowercase letters, return a map
// of the letter with the most repetition and containing the corresponding count.
// If several letters have the same occurrence, return all of them.
// Example:
// >>> histogram("a b c")
// map[string]int{"a": 1, "b": 1, "c": 1}
// >>> histogram("a b b a")
// map[string]int{"a": 2, "b": 2}
// >>> histogram("a b c a b")
// map[string]int{"a": 2, "b": 2}
// >>> histogram("b b b b a")
// map[string]int{"b": 4}
// >>> histogram("")
// map[string]int{}
func histogram(test string) map[string]int {

func TestHistogram(t *testing.T) {
  candidate := histogram
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("a b b a"), expected: map[string]int{"a": 2, "b": 2} },
     { actual: candidate("a b c a b"), expected: map[string]int{"a": 2, "b": 2} },
     { actual: candidate("a b c d g"), expected: map[string]int{"a": 1, "b": 1, "c": 1, "d": 1, "g": 1} },
     { actual: candidate("r t g"), expected: map[string]int{"r": 1, "t": 1, "g": 1} },
     { actual: candidate("b b b b a"), expected: map[string]int{"b": 4} },
     { actual: candidate("r t g"), expected: map[string]int{"r": 1, "t": 1, "g": 1} },
     { actual: candidate(""), expected: map[string]int{} },
     { actual: candidate("a"), expected: map[string]int{"a": 1} },
   }

	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 get_row_test

import (
    "testing"
    "fmt"
)

// You are given a 2 dimensional data, as a nested lists,
// which is similar to matrix, however, unlike matrices,
// each row may contain a different number of columns.
// Given lst, and integer x, find integers x in the list,
// and return list of lists, [(x1, y1), (x2, y2) ...] such that
// each list is a coordinate - (row, columns), starting with 0.
// Sort coordinates initially by rows in ascending order.
// Also, sort coordinates of the row by columns in descending order.
// Examples:
// >>> get_row([][]int{[]int{1, 2, 3, 4, 5, 6}, []int{1, 2, 3, 4, 1, 6}, []int{1, 2, 3, 4, 5, 1}}, 1)
// [][]int{[]interface{}{0, 0}, []interface{}{1, 4}, []interface{}{1, 0}, []interface{}{2, 5}, []interface{}{2, 0}}
// >>> get_row([][]int{}, 1)
// [][]interface{}{}
// >>> get_row([]interface{}{[]interface{}{}, []int{1}, []int{1, 2, 3}}, 3)
// [][]int{[]interface{}{2, 2}}
func get_row(lst [][]int, x int) [][]interface{} {


Prompt:
package get_odd_collatz_test

import (
    "testing"
    "fmt"
)

// Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.
// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined
// as follows: start with any positive integer n. Then each term is obtained from the
// previous term as follows: if the previous term is even, the next term is one half of
// the previous term. If the previous term is odd, the next term is 3 times the previous
// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.
// Note:
// 1. Collatz(1) is [1].
// 2. returned list sorted in increasing order.
// For example:
// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.
// >>> get_odd_collatz(5)
// []int{1, 5}
func get_odd_collatz(n int) []int {

func TestGet_Odd_Collatz(t *testing.T) {
  candidate := get_odd_collatz
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(14), expected: []int{1, 5, 7, 11, 13, 17} },
     { actual: candidate(5), expected: []int{1, 5} },
     { actual: candidate(12), expected: []int{1, 3, 5} },
     { actual: candidate(1), expected: []int{1} },
   }

	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 can_arrange_test

import (
    "testing"
    "fmt"
)

// Create a function which returns the largest index of an element which
// is not greater than or equal to the element immediately preceding it. If
// no such element exists then return -1. The given list will not contain
// duplicate values.
// Examples:
// >>> can_arrange([]int{1, 2, 4, 3, 5})
// 3
// >>> can_arrange([]int{1, 2, 3})
// -1
func can_arrange(arr []int) int {

func TestCan_Arrange(t *testing.T) {
  candidate := can_arrange
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 4, 3, 5}), expected: 3 },
     { actual: candidate([]int{1, 2, 4, 5}), expected: -1 },
     { actual: candidate([]int{1, 4, 2, 5, 6, 7, 8, 9, 10}), expected: 2 },
     { actual: candidate([]int{4, 8, 5, 7, 3}), expected: 4 },
     { actual: candidate([]int{}), expected: -1 },
   }

	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 sort_numbers_test

import (
    "testing"
    "fmt"
)

// Input is a space-delimited string of numberals from 'zero' to 'nine'.
// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
// Return the string with numbers sorted from smallest to largest
// >>> sort_numbers("three one five")
// "one three five"
func sort_numbers(numbers string) string {

func TestSort_Numbers(t *testing.T) {
  candidate := sort_numbers
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(""), expected: "" },
     { actual: candidate("three"), expected: "three" },
     { actual: candidate("three five nine"), expected: "three five nine" },
     { actual: candidate("five zero four seven nine eight"), expected: "zero four five seven eight nine" },
     { actual: candidate("six five four three two one zero"), expected: "zero one two three four five six" },
   }

	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 circular_shift_test

import (
    "testing"
    "fmt"
)

// Circular shift the digits of the integer x, shift the digits right by shift
// and return the result as a string.
// If shift > number of digits, return digits reversed.
// >>> circular_shift(12, 1)
// "21"
// >>> circular_shift(12, 2)
// "12"
func circular_shift(x int, shift int) string {

func TestCircular_Shift(t *testing.T) {
  candidate := circular_shift
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(100, 2), expected: "001" },
     { actual: candidate(12, 2), expected: "12" },
     { actual: candidate(97, 8), expected: "79" },
     { actual: candidate(12, 1), expected: "21" },
     { actual: candidate(11, 101), expected: "11" },
   }

	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 sum_squares_test

import (
    "testing"
    "fmt"
)

// "
// This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a
// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not
// change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries.
// Examples:
// >>> lst
// []int{1, 2, 3}
// >>> lst
// int{}
// >>> lst
// []int{-1, -5, 2, -1, -5}
func sum_squares(lst []int) int {

func TestSum_Squares(t *testing.T) {
  candidate := sum_squares
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 3}), expected: 6 },
     { actual: candidate([]int{1, 4, 9}), expected: 14 },
     { actual: candidate([]int{}), expected: 0 },
     { actual: candidate([]int{1, 1, 1, 1, 1, 1, 1, 1, 1}), expected: 9 },
     { actual: candidate([]int{-1, -1, -1, -1, -1, -1, -1, -1, -1}), expected: -3 },
     { actual: candidate([]int{0}), expected: 0 },
     { actual: candidate([]int{-1, -5, 2, -1, -5}), expected: -126 },
     { actual: candidate([]int{-56, -99, 1, 0, -2}), expected: 3030 },
     { actual: candidate([]int{-1, 0, 0, 0, 0, 0, 0, 0, -1}), expected: 0 },
     { actual: candidate([]int{-16, -9, -2, 36, 36, 26, -20, 25, -40, 20, -4, 12, -26, 35, 37}), expected: -14196 },
     { actual: candidate([]int{-1, -3, 17, -1, -15, 13, -1, 14, -14, -12, -5, 14, -14, 6, 13, 11, 16, 16, 4, 10}), expected: -1448 },
   }

	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 skjkasdkd_test

import (
    "testing"
    "fmt"
)

// You are given a list of integers.
// You need to find the largest prime value and return the sum of its digits.
// Examples:
// >>> skjkasdkd([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3})
// 10
// >>> skjkasdkd([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1})
// 25
// >>> skjkasdkd([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3})
// 13
// >>> skjkasdkd([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6})
// 11
// >>> skjkasdkd([]int{0, 81, 12, 3, 1, 21})
// 3
// >>> skjkasdkd([]int{0, 8, 1, 2, 1, 7})
// 7
func skjkasdkd(lst []int) int {

func TestSkjkasdkd(t *testing.T) {
  candidate := skjkasdkd
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3}), expected: 10 },
     { actual: candidate([]int{1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1}), expected: 25 },
     { actual: candidate([]int{1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3}), expected: 13 },
     { actual: candidate([]int{0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6}), expected: 11 },
     { actual: candidate([]int{0, 81, 12, 3, 1, 21}), expected: 3 },
     { actual: candidate([]int{0, 8, 1, 2, 1, 7}), expected: 7 },
     { actual: candidate([]int{8191}), expected: 19 },
     { actual: candidate([]int{8191, 123456, 127, 7}), expected: 19 },
     { actual: candidate([]int{127, 97, 8192}), expected: 10 },
   }

	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 sum_product_test

import (
    "testing"
    "fmt"
)

// For a given list of integers, return a list consisting of a sum and a product of all the integers in a list.
// Empty sum should be equal to 0 and empty product should be equal to 1.
// >>> sum_product([]int{})
// []interface{}{0, 1}
// >>> sum_product([]int{1, 2, 3, 4})
// []interface{}{10, 24}
func sum_product(numbers []int) []interface{} {

func TestSum_Product(t *testing.T) {
  candidate := sum_product
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{}), expected: []interface{}{0, 1} },
     { actual: candidate([]int{1, 1, 1}), expected: []interface{}{3, 1} },
     { actual: candidate([]int{100, 0}), expected: []interface{}{100, 0} },
     { actual: candidate([]int{3, 5, 7}), expected: []interface{}{15, 105} },
     { actual: candidate([]int{10}), expected: []interface{}{10, 10} },
   }

	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 choose_num_test

import (
    "testing"
    "fmt"
)

// This function takes two positive numbers x and y and returns the
// biggest even integer number that is in the range [x, y] inclusive. If
// there's no such number, then the function should return -1.
// For example:
// >>> choose_num(12, 15)
// 14
// >>> choose_num(13, 12)
// -1
func choose_num(x int, y int) int {

func TestChoose_Num(t *testing.T) {
  candidate := choose_num
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(12, 15), expected: 14 },
     { actual: candidate(13, 12), expected: -1 },
     { actual: candidate(33, 12354), expected: 12354 },
     { actual: candidate(5234, 5233), expected: -1 },
     { actual: candidate(6, 29), expected: 28 },
     { actual: candidate(27, 10), expected: -1 },
     { actual: candidate(7, 7), expected: -1 },
     { actual: candidate(546, 546), expected: 546 },
   }

	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 largest_smallest_integers_test

import (
    "testing"
    "fmt"
)

// Create a function that returns a list (a, b), where 'a' is
// the largest of negative integers, and 'b' is the smallest
// of positive integers in a list.
// If there is no negative or positive integers, return them as nil.
// Examples:
// >>> largest_smallest_integers([]int{2, 4, 1, 3, 5, 7})
// []interface{}{nil, 1}
// >>> largest_smallest_integers([]int{})
// []interface{}{nil, nil}
// >>> largest_smallest_integers([]int{0})
// []interface{}{nil, nil}
func largest_smallest_integers(lst []int) []interface{} {

func TestLargest_Smallest_Integers(t *testing.T) {
  candidate := largest_smallest_integers
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{2, 4, 1, 3, 5, 7}), expected: []interface{}{nil, 1} },
     { actual: candidate([]int{2, 4, 1, 3, 5, 7, 0}), expected: []interface{}{nil, 1} },
     { actual: candidate([]int{1, 3, 2, 4, 5, 6, -2}), expected: []interface{}{-2, 1} },
     { actual: candidate([]int{4, 5, 3, 6, 2, 7, -7}), expected: []interface{}{-7, 2} },
     { actual: candidate([]int{7, 3, 8, 4, 9, 2, 5, -9}), expected: []interface{}{-9, 2} },
     { actual: candidate([]int{}), expected: []interface{}{nil, nil} },
     { actual: candidate([]int{0}), expected: []interface{}{nil, nil} },
     { actual: candidate([]int{-1, -3, -5, -6}), expected: []interface{}{-1, nil} },
     { actual: candidate([]int{-1, -3, -5, -6, 0}), expected: []interface{}{-1, nil} },
     { actual: candidate([]int{-6, -4, -4, -3, 1}), expected: []interface{}{-3, 1} },
     { actual: candidate([]int{-6, -4, -4, -3, -100, 1}), expected: []interface{}{-3, 1} },
   }

	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_distinct_characters_test

import (
    "testing"
    "fmt"
)

// Given a string, find out how many distinct characters (regardless of case) does it consist of
// >>> count_distinct_characters("xyzXYZ")
// 3
// >>> count_distinct_characters("Jerry")
// 4
func count_distinct_characters(myString string) int {

func TestCount_Distinct_Characters(t *testing.T) {
  candidate := count_distinct_characters
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(""), expected: 0 },
     { actual: candidate("abcde"), expected: 5 },
     { actual: candidate("abcdecadeCADE"), expected: 5 },
     { actual: candidate("aaaaAAAAaaaa"), expected: 1 },
     { actual: candidate("Jerry jERRY JeRRRY"), expected: 5 },
   }

	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 make_a_pile_test

import (
    "testing"
    "fmt"
)

// Given a positive integer n, you have to make a pile of n levels of stones.
// The first level has n stones.
// The number of stones in the next level is:
// - the next odd number if n is odd.
// - the next even number if n is even.
// Return the number of stones in each level in a list, where element at index
// i represents the number of stones in the level (i+1).
// Examples:
// >>> make_a_pile(3)
// []int{3, 5, 7}
func make_a_pile(n int) []int {

func TestMake_A_Pile(t *testing.T) {
  candidate := make_a_pile
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(3), expected: []int{3, 5, 7} },
     { actual: candidate(4), expected: []int{4, 6, 8, 10} },
     { actual: candidate(5), expected: []int{5, 7, 9, 11, 13} },
     { actual: candidate(6), expected: []int{6, 8, 10, 12, 14, 16} },
     { actual: candidate(8), expected: []int{8, 10, 12, 14, 16, 18, 20, 22} },
   }

	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 minSubArraySum_test

import (
    "testing"
    "fmt"
)

// Given a list of integers nums, find the minimum sum of any non-empty sub-list
// of nums.
// Example
// >>> minSubArraySum([]int{2, 3, 4, 1, 2, 4})
// 1
// >>> minSubArraySum([]int{-1, -2, -3})
// -6
func minSubArraySum(nums []int) int {

func TestMinsubarraysum(t *testing.T) {
  candidate := minSubArraySum
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{2, 3, 4, 1, 2, 4}), expected: 1 },
     { actual: candidate([]int{-1, -2, -3}), expected: -6 },
     { actual: candidate([]int{-1, -2, -3, 2, -10}), expected: -14 },
     { actual: candidate([]int{-9999999999999999}), expected: -9999999999999999 },
     { actual: candidate([]int{0, 10, 20, 1000000}), expected: 0 },
     { actual: candidate([]int{-1, -2, -3, 10, -5}), expected: -6 },
     { actual: candidate([]int{100, -1, -2, -3, 10, -5}), expected: -6 },
     { actual: candidate([]int{10, 11, 13, 8, 3, 4}), expected: 3 },
     { actual: candidate([]int{100, -33, 32, -1, 0, -2}), expected: -33 },
     { actual: candidate([]int{-10}), expected: -10 },
     { actual: candidate([]int{7}), expected: 7 },
     { actual: candidate([]int{1, -1}), expected: -1 },
   }

	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 string_sequence_test

import (
    "testing"
    "fmt"
)

// Return a string containing space-delimited numbers starting from 0 upto n inclusive.
// >>> string_sequence(0)
// "0"
// >>> string_sequence(5)
// "0 1 2 3 4 5"
func string_sequence(n int) string {

func TestString_Sequence(t *testing.T) {
  candidate := string_sequence
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(0), expected: "0" },
     { actual: candidate(3), expected: "0 1 2 3" },
     { actual: candidate(10), expected: "0 1 2 3 4 5 6 7 8 9 10" },
   }

	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 cycpattern_check_test

import (
    "testing"
    "fmt"
)

// You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word
// >>> cycpattern_check("abcd", "abd")
// false
// >>> cycpattern_check("hello", "ell")
// true
// >>> cycpattern_check("whassup", "psus")
// false
// >>> cycpattern_check("abab", "baa")
// true
// >>> cycpattern_check("efef", "eeff")
// false
// >>> cycpattern_check("himenss", "simen")
// true
func cycpattern_check(a string, b string) bool {

func TestCycpattern_Check(t *testing.T) {
  candidate := cycpattern_check
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("xyzw", "xyw"), expected: false },
     { actual: candidate("yello", "ell"), expected: true },
     { actual: candidate("whattup", "ptut"), expected: false },
     { actual: candidate("efef", "fee"), expected: true },
     { actual: candidate("abab", "aabb"), expected: false },
     { actual: candidate("winemtt", "tinem"), expected: true },
   }

	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 monotonic_test

import (
    "testing"
    "fmt"
)

// Return true is list elements are monotonically increasing or decreasing.
// >>> monotonic([]int{1, 2, 4, 20})
// true
// >>> monotonic([]int{1, 20, 4, 10})
// false
// >>> monotonic([]int{4, 1, 0, -10})
// true
func monotonic(l []int) bool {

func TestMonotonic(t *testing.T) {
  candidate := monotonic
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 4, 10}), expected: true },
     { actual: candidate([]int{1, 2, 4, 20}), expected: true },
     { actual: candidate([]int{1, 20, 4, 10}), expected: false },
     { actual: candidate([]int{4, 1, 0, -10}), expected: true },
     { actual: candidate([]int{4, 1, 1, 0}), expected: true },
     { actual: candidate([]int{1, 2, 3, 2, 5, 60}), expected: false },
     { actual: candidate([]int{1, 2, 3, 4, 5, 60}), expected: true },
     { actual: candidate([]int{9, 9, 9, 9}), expected: true },
   }

	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 below_threshold_test

import (
    "testing"
    "fmt"
)

// Return true if all numbers in the list l are below threshold t.
// >>> below_threshold([]int{1, 2, 4, 10}, 100)
// true
// >>> below_threshold([]int{1, 20, 4, 10}, 5)
// false
func below_threshold(l []int, t int) bool {

func TestBelow_Threshold(t *testing.T) {
  candidate := below_threshold
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 4, 10}, 100), expected: true },
     { actual: candidate([]int{1, 20, 4, 10}, 5), expected: false },
     { actual: candidate([]int{1, 20, 4, 10}, 21), expected: true },
     { actual: candidate([]int{1, 20, 4, 10}, 22), expected: true },
     { actual: candidate([]int{1, 8, 4, 10}, 11), expected: true },
     { actual: candidate([]int{1, 8, 4, 10}, 10), 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 is_multiply_prime_test

import (
    "testing"
    "fmt"
)

// Write a function that returns true if the given number is the multiplication of 3 prime numbers
// and false otherwise.
// Knowing that (a) is less then 100.
// Example:
// >>> is_multiply_prime(30)
// true
// 30 = 2 * 3 * 5
func is_multiply_prime(a int) bool {

func TestIs_Multiply_Prime(t *testing.T) {
  candidate := is_multiply_prime
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(5), expected: false },
     { actual: candidate(30), expected: true },
     { actual: candidate(8), expected: true },
     { actual: candidate(10), expected: false },
     { actual: candidate(125), expected: true },
     { actual: candidate(105), expected: true },
     { actual: candidate(126), expected: false },
     { actual: candidate(729), expected: false },
     { actual: candidate(891), expected: false },
     { actual: candidate(1001), expected: true },
   }

	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 get_positive_test

import (
    "testing"
    "fmt"
)

// Return only positive numbers in the list.
// >>> get_positive([]int{-1, 2, -4, 5, 6})
// []int{2, 5, 6}
// >>> get_positive([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})
// []int{5, 3, 2, 3, 9, 123, 1}
func get_positive(l []int) []int {

func TestGet_Positive(t *testing.T) {
  candidate := get_positive
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{-1, -2, 4, 5, 6}), expected: []int{4, 5, 6} },
     { actual: candidate([]int{5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}), expected: []int{5, 3, 2, 3, 3, 9, 123, 1} },
     { actual: candidate([]int{-1, -2}), expected: []int{} },
     { actual: candidate([]int{}), expected: []int{} },
   }

	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 sort_third_test

import (
    "testing"
    "fmt"
)

// This function takes a list l and returns a list l' such that
// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal
// to the values of the corresponding indicies of l, but sorted.
// >>> sort_third([]int{1, 2, 3})
// []int{1, 2, 3}
// >>> sort_third([]int{5, 6, 3, 4, 8, 9, 2})
// []int{2, 6, 3, 4, 8, 9, 5}
func sort_third(l []int) []int {

func TestSort_Third(t *testing.T) {
  candidate := sort_third
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2}), expected: []int{2, 6, 3, 4, 8, 9, 5} },
     { actual: candidate([]int{5, 8, 3, 4, 6, 9, 2}), expected: []int{2, 8, 3, 4, 6, 9, 5} },
     { actual: candidate([]int{5, 6, 9, 4, 8, 3, 2}), expected: []int{2, 6, 9, 4, 8, 3, 5} },
     { actual: candidate([]int{5, 6, 3, 4, 8, 9, 2, 1}), expected: []int{2, 6, 3, 4, 8, 9, 5, 1} },
   }

	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 parse_nested_parens_test

import (
    "testing"
    "fmt"
)

// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
// For each of the group, output the deepest level of nesting of parentheses.
// E.g. (()()) has maximum two levels of nesting while ((())) has three.
// >>> parse_nested_parens("(()()) ((())) () ((())()())")
// []int{2, 3, 1, 3}
func parse_nested_parens(paren_string string) []int {

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

	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 triangle_area_test

import (
    "testing"
    "fmt"
)

// Given length of a side and high return area for a triangle.
// >>> triangle_area(5, 3)
// 7.5
func triangle_area(a int, h int) float64 {

func TestTriangle_Area(t *testing.T) {
  candidate := triangle_area
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(5, 3), expected: 7.5 },
     { actual: candidate(2, 2), expected: 2.0 },
     { actual: candidate(10, 8), expected: 40.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 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 mean_absolute_deviation_test

import (
    "testing"
    "fmt"
)

// For a given list of input numbers, calculate Mean Absolute Deviation
// around the mean of this dataset.
// Mean Absolute Deviation is the average absolute difference between each
// element and a centerpoint (mean in this case):
// MAD = average | x - x_mean |
// >>> mean_absolute_deviation([]float64{1.0, 2.0, 3.0, 4.0})
// 1.0
func mean_absolute_deviation(numbers []float64) float64 {

func TestMean_Absolute_Deviation(t *testing.T) {
  candidate := mean_absolute_deviation
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]float64{1.0, 2.0}), expected: 0.5 },
     { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0}), expected: 1.0 },
     { actual: candidate([]float64{1.0, 2.0, 3.0, 4.0, 5.0}), expected: 1.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 common_test

import (
    "testing"
    "fmt"
)

// Return sorted unique common elements for two lists.
// >>> common([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121})
// []int{1, 5, 653}
// >>> common([]int{5, 3, 2, 8}, []int{3, 2})
// []int{2, 3}
func common(l1 []int, l2 []int) []int {

func TestCommon(t *testing.T) {
  candidate := common
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 4, 3, 34, 653, 2, 5}, []int{5, 7, 1, 5, 9, 653, 121}), expected: []int{1, 5, 653} },
     { actual: candidate([]int{5, 3, 2, 8}, []int{3, 2}), expected: []int{2, 3} },
     { actual: candidate([]int{4, 3, 2, 8}, []int{3, 2, 4}), expected: []int{2, 3, 4} },
     { actual: candidate([]int{4, 3, 2, 8}, []int{}), expected: []int{} },
   }

	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 int_to_mini_roman_test

import (
    "testing"
    "fmt"
)

// Given a positive integer, obtain its roman numeral equivalent as a string,
// and return it in lowercase.
// Restrictions: 1 <= num <= 1000
// Examples:
// >>> int_to_mini_roman(19)
// "xix"
// >>> int_to_mini_roman(152)
// "clii"
// >>> int_to_mini_roman(426)
// "cdxxvi"
func int_to_mini_roman(number int) string {

func TestInt_To_Mini_Roman(t *testing.T) {
  candidate := int_to_mini_roman
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(19), expected: "xix" },
     { actual: candidate(152), expected: "clii" },
     { actual: candidate(251), expected: "ccli" },
     { actual: candidate(426), expected: "cdxxvi" },
     { actual: candidate(500), expected: "d" },
     { actual: candidate(1), expected: "i" },
     { actual: candidate(4), expected: "iv" },
     { actual: candidate(43), expected: "xliii" },
     { actual: candidate(90), expected: "xc" },
     { actual: candidate(94), expected: "xciv" },
     { actual: candidate(532), expected: "dxxxii" },
     { actual: candidate(900), expected: "cm" },
     { actual: candidate(994), expected: "cmxciv" },
     { actual: candidate(1000), expected: "m" },
   }

	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 fruit_distribution_test

import (
    "testing"
    "fmt"
)

// In this task, you will be given a string that represents a number of apples and oranges
// that are distributed in a basket of fruit this basket contains
// apples, oranges, and mango fruits. Given the string that represents the total number of
// the oranges and apples and an integer that represent the total number of the fruits
// in the basket return the number of the mango fruits in the basket.
// for examble:
// >>> fruit_distribution("5 apples and 6 oranges", 19)
// 8
// >>> fruit_distribution("0 apples and 1 oranges", 3)
// 2
// >>> fruit_distribution("2 apples and 3 oranges", 100)
// 95
// >>> fruit_distribution("100 apples and 1 oranges", 120)
// 19
func fruit_distribution(s string, n int) int {

func TestFruit_Distribution(t *testing.T) {
  candidate := fruit_distribution
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("5 apples and 6 oranges", 19), expected: 8 },
     { actual: candidate("5 apples and 6 oranges", 21), expected: 10 },
     { actual: candidate("0 apples and 1 oranges", 3), expected: 2 },
     { actual: candidate("1 apples and 0 oranges", 3), expected: 2 },
     { actual: candidate("2 apples and 3 oranges", 100), expected: 95 },
     { actual: candidate("2 apples and 3 oranges", 5), expected: 0 },
     { actual: candidate("1 apples and 100 oranges", 120), expected: 19 },
   }

	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 reverse_delete_test

import (
    "testing"
    "fmt"
)

// Task
// We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c
// then check if the result string is palindrome.
// A string is called palindrome if it reads the same backward as forward.
// You should return a list containing the result string and true/false for the check.
// Example
// >>> reverse_delete("abcde", "ae")
// []interface{}{"bcd", false}
// >>> reverse_delete("abcdef", "b")
// []interface{}{"acdef", false}
// >>> reverse_delete("abcdedcba", "ab")
// []interface{}{"cdedc", true}
func reverse_delete(s string, c string) []interface{} {

func TestReverse_Delete(t *testing.T) {
  candidate := reverse_delete
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("abcde", "ae"), expected: []interface{}{"bcd", false} },
     { actual: candidate("abcdef", "b"), expected: []interface{}{"acdef", false} },
     { actual: candidate("abcdedcba", "ab"), expected: []interface{}{"cdedc", true} },
     { actual: candidate("dwik", "w"), expected: []interface{}{"dik", false} },
     { actual: candidate("a", "a"), expected: []interface{}{"", true} },
     { actual: candidate("abcdedcba", ""), expected: []interface{}{"abcdedcba", true} },
     { actual: candidate("abcdedcba", "v"), expected: []interface{}{"abcdedcba", true} },
     { actual: candidate("vabba", "v"), expected: []interface{}{"abba", true} },
     { actual: candidate("mamma", "mia"), expected: []interface{}{"", true} },
   }

	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 greatest_common_divisor_test

import (
    "testing"
    "fmt"
)

// Return a greatest common divisor of two integers a and b
// >>> greatest_common_divisor(3, 5)
// 1
// >>> greatest_common_divisor(25, 15)
// 5
func greatest_common_divisor(a int, b int) int {

func TestGreatest_Common_Divisor(t *testing.T) {
  candidate := greatest_common_divisor
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(3, 7), expected: 1 },
     { actual: candidate(10, 15), expected: 5 },
     { actual: candidate(49, 14), expected: 7 },
     { actual: candidate(144, 60), expected: 12 },
   }

	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 sort_array_test

import (
    "testing"
    "fmt"
)

// In this Kata, you have to sort a list of non-negative integers according to
// number of ones in their binary representation in ascending order.
// For similar number of ones, sort based on decimal value.
// It must be implemented like this:
// >>> sort_array([]int{1, 5, 2, 3, 4})
// []int{1, 2, 3, 4, 5}
// >>> sort_array([]int{-2, -3, -4, -5, -6})
// []int{-6, -5, -4, -3, -2}
// >>> sort_array([]int{1, 0, 2, 3, 4})
// []int{0, 1, 2, 3, 4}
func sort_array(arr []int) []int {

func TestSort_Array(t *testing.T) {
  candidate := sort_array
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 5, 2, 3, 4}), expected: []int{1, 2, 4, 3, 5} },
     { actual: candidate([]int{-2, -3, -4, -5, -6}), expected: []int{-4, -2, -6, -5, -3} },
     { actual: candidate([]int{1, 0, 2, 3, 4}), expected: []int{0, 1, 2, 4, 3} },
     { actual: candidate([]int{}), expected: []int{} },
     { actual: candidate([]int{2, 5, 77, 4, 5, 3, 5, 7, 2, 3, 4}), expected: []int{2, 2, 4, 4, 3, 3, 5, 5, 5, 7, 77} },
     { actual: candidate([]int{3, 6, 44, 12, 32, 5}), expected: []int{32, 3, 5, 6, 12, 44} },
     { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },
     { actual: candidate([]int{2, 4, 8, 16, 32}), expected: []int{2, 4, 8, 16, 32} },
   }

	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 concatenate_test

import (
    "testing"
    "fmt"
)

// Concatenate list of strings into a single string
// >>> concatenate([]string{})
// ""
// >>> concatenate([]string{"a", "b", "c"})
// "abc"
func concatenate(strings []string) string {

func TestConcatenate(t *testing.T) {
  candidate := concatenate
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]string{}), expected: "" },
     { actual: candidate([]string{"x", "y", "z"}), expected: "xyz" },
     { actual: candidate([]string{"x", "y", "z", "w", "k"}), expected: "xyzwk" },
   }

	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 sorted_list_sum_test

import (
    "testing"
    "fmt"
)

// Write a function that accepts a list of strings as a parameter,
// deletes the strings that have odd lengths from it,
// and returns the resulted list with a sorted order,
// The list is always a list of strings and never a list of numbers,
// and it may contain duplicates.
// The order of the list should be ascending by length of each word, and you
// should return the list sorted by that rule.
// If two words have the same length, sort the list alphabetically.
// The function should return a list of strings in sorted order.
// You may assume that all words will have the same length.
// For example:
// >>> list_sort([]string{"aa", "a", "aaa"})
// []string{"aa"}
// >>> list_sort([]string{"ab", "a", "aaa", "cd"})
// []string{"ab", "cd"}
func sorted_list_sum(lst []string) []string {

func TestSorted_List_Sum(t *testing.T) {
  candidate := sorted_list_sum
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]string{"aa", "a", "aaa"}), expected: []string{"aa"} },
     { actual: candidate([]string{"school", "AI", "asdf", "b"}), expected: []string{"AI", "asdf", "school"} },
     { actual: candidate([]string{"d", "b", "c", "a"}), expected: []string{} },
     { actual: candidate([]string{"d", "dcba", "abcd", "a"}), expected: []string{"abcd", "dcba"} },
     { actual: candidate([]string{"AI", "ai", "au"}), expected: []string{"AI", "ai", "au"} },
     { actual: candidate([]string{"a", "b", "b", "c", "c", "a"}), expected: []string{} },
     { actual: candidate([]string{"aaaa", "bbbb", "dd", "cc"}), expected: []string{"cc", "dd", "aaaa", "bbbb"} },
   }

	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 filter_by_substring_test

import (
    "testing"
    "fmt"
)

// Filter an input list of strings only for ones that contain given substring
// >>> filter_by_substring([]string{}, "a")
// []string{}
// >>> filter_by_substring([]string{"abc", "bacd", "cde", "array"}, "a")
// []string{"abc", "bacd", "array"}
func filter_by_substring(strings []string, substring string) []string {

func TestFilter_By_Substring(t *testing.T) {
  candidate := filter_by_substring
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]string{}, "john"), expected: []string{} },
     { actual: candidate([]string{"xxx", "asd", "xxy", "john doe", "xxxAAA", "xxx"}, "xxx"), expected: []string{"xxx", "xxxAAA", "xxx"} },
     { actual: candidate([]string{"xxx", "asd", "aaaxxy", "john doe", "xxxAAA", "xxx"}, "xx"), expected: []string{"xxx", "aaaxxy", "xxxAAA", "xxx"} },
     { actual: candidate([]string{"grunt", "trumpet", "prune", "gruesome"}, "run"), expected: []string{"grunt", "prune"} },
   }

	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 vowels_count_test

import (
    "testing"
    "fmt"
)

// Write a function vowels_count which takes a string representing
// a word as input and returns the number of vowels in the string.
// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a
// vowel, but only when it is at the end of the given word.
// Example:
// >>> vowels_count("abcde")
// 2
// >>> vowels_count("ACEDY")
// 3
func vowels_count(s string) int {

func TestVowels_Count(t *testing.T) {
  candidate := vowels_count
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("abcde"), expected: 2 },
     { actual: candidate("Alone"), expected: 3 },
     { actual: candidate("key"), expected: 2 },
     { actual: candidate("bye"), expected: 1 },
     { actual: candidate("keY"), expected: 2 },
     { actual: candidate("bYe"), expected: 1 },
     { actual: candidate("ACEDY"), expected: 3 },
   }

	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 find_max_test

import (
    "testing"
    "fmt"
)

// Write a function that accepts a list of strings.
// The list contains different words. Return the word with maximum number
// of unique characters. If multiple strings have maximum number of unique
// characters, return the one which comes first in lexicographical order.
// >>> find_max([]string{"name", "of", "string"})
// "string"
// >>> find_max([]string{"name", "enam", "game"})
// "enam"
// >>> find_max([]string{"aaaaaaa", "bb", "cc"})
// "aaaaaaa"
func find_max(words []string) string {

func TestFind_Max(t *testing.T) {
  candidate := find_max
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]string{"name", "of", "string"}), expected: "string" },
     { actual: candidate([]string{"name", "enam", "game"}), expected: "enam" },
     { actual: candidate([]string{"aaaaaaa", "bb", "cc"}), expected: "aaaaaaa" },
     { actual: candidate([]string{"abc", "cba"}), expected: "abc" },
     { actual: candidate([]string{"play", "this", "game", "of", "footbott"}), expected: "footbott" },
     { actual: candidate([]string{"we", "are", "gonna", "rock"}), expected: "gonna" },
     { actual: candidate([]string{"we", "are", "a", "mad", "nation"}), expected: "nation" },
     { actual: candidate([]string{"this", "is", "a", "prrk"}), expected: "this" },
     { actual: candidate([]string{"b"}), expected: "b" },
     { actual: candidate([]string{"play", "play", "play"}), expected: "play" },
   }

	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 change_base_test

import (
    "testing"
    "fmt"
)

// Change numerical base of input number x to base.
// return string representation after the conversion.
// base numbers are less than 10.
// >>> change_base(8, 3)
// "22"
// >>> change_base(8, 2)
// "1000"
// >>> change_base(7, 2)
// "111"
func change_base(x int, base int) string {

func TestChange_Base(t *testing.T) {
  candidate := change_base
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(8, 3), expected: "22" },
     { actual: candidate(9, 3), expected: "100" },
     { actual: candidate(234, 2), expected: "11101010" },
     { actual: candidate(16, 2), expected: "10000" },
     { actual: candidate(8, 2), expected: "1000" },
     { actual: candidate(7, 2), expected: "111" },
     { actual: candidate(2, 3), expected: "2" },
     { actual: candidate(3, 4), expected: "3" },
     { actual: candidate(4, 5), expected: "4" },
     { actual: candidate(5, 6), expected: "5" },
     { actual: candidate(6, 7), expected: "6" },
     { actual: candidate(7, 8), expected: "7" },
   }

	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 right_angle_triangle_test

import (
    "testing"
    "fmt"
)

// Given the lengths of the three sides of a triangle. Return true if the three
// sides form a right-angled triangle, false otherwise.
// A right-angled triangle is a triangle in which one angle is right angle or
// 90 degree.
// Example:
// >>> right_angle_triangle(3, 4, 5)
// true
// >>> right_angle_triangle(1, 2, 3)
// false
func right_angle_triangle(a int, b int, c int) bool {

func TestRight_Angle_Triangle(t *testing.T) {
  candidate := right_angle_triangle
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(3, 4, 5), expected: true },
     { actual: candidate(1, 2, 3), expected: false },
     { actual: candidate(10, 6, 8), expected: true },
     { actual: candidate(2, 2, 2), expected: false },
     { actual: candidate(7, 24, 25), expected: true },
     { actual: candidate(10, 5, 7), expected: false },
     { actual: candidate(5, 12, 13), expected: true },
     { actual: candidate(15, 8, 17), expected: true },
     { actual: candidate(48, 55, 73), expected: true },
     { actual: candidate(1, 1, 1), expected: false },
     { actual: candidate(2, 2, 10), 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 numerical_letter_grade_test

import (
    "testing"
    "fmt"
)

// It is the last week of the semester and the teacher has to give the grades
// to students. The teacher has been making her own algorithm for grading.
// The only problem is, she has lost the code she used for grading.
// She has given you a list of GPAs for some students and you have to write
// a function that can output a list of letter grades using the following table:
// GPA       |    Letter grade
// 4.0                A+
// > 3.7                A
// > 3.3                A-
// > 3.0                B+
// > 2.7                B
// > 2.3                B-
// > 2.0                C+
// > 1.7                C
// > 1.3                C-
// > 1.0                D+
// > 0.7                D
// > 0.0                D-
// 0.0                E
// Example:
// >>> grade_equation([]float64{4.0, 3, 1.7, 2, 3.5})
// []string{"A+", "B", "C-", "C", "A-"}
func numerical_letter_grade(grades []float64) []string {

func TestNumerical_Letter_Grade(t *testing.T) {
  candidate := numerical_letter_grade
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]float64{4.0, 3, 1.7, 2, 3.5}), expected: []string{"A+", "B", "C-", "C", "A-"} },
     { actual: candidate([]float64{1.2}), expected: []string{"D+"} },
     { actual: candidate([]float64{0.5}), expected: []string{"D-"} },
     { actual: candidate([]float64{0.0}), expected: []string{"E"} },
     { actual: candidate([]float64{1.0, 0.3, 1.5, 2.8, 3.3}), expected: []string{"D", "D-", "C-", "B", "B+"} },
     { actual: candidate([]float64{0.0, 0.7}), expected: []string{"E", "D-"} },
   }

	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 intersperse_test

import (
    "testing"
    "fmt"
)

// Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
// >>> intersperse([]int{}, 4)
// []int{}
// >>> intersperse([]int{1, 2, 3}, 4)
// []int{1, 4, 2, 4, 3}
func intersperse(numbers []int, delimeter int) []int {

func TestIntersperse(t *testing.T) {
  candidate := intersperse
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{}, 7), expected: []int{} },
     { actual: candidate([]int{5, 6, 3, 2}, 8), expected: []int{5, 8, 6, 8, 3, 8, 2} },
     { actual: candidate([]int{2, 2, 2}, 2), expected: []int{2, 2, 2, 2, 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 specialFilter_test

import (
    "testing"
    "fmt"
)

// Write a function that takes a list of numbers as input and returns
// the number of elements in the list that are greater than 10 and both
// first and last digits of a number are odd (1, 3, 5, 7, 9).
// For example:
// >>> specialFilter([]int{15, -73, 14, -15})
// 1
// >>> specialFilter([]int{33, -2, -3, 45, 21, 109})
// 2
func specialFilter(nums []int) int {

func TestSpecialfilter(t *testing.T) {
  candidate := specialFilter
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{5, -2, 1, -5}), expected: 0 },
     { actual: candidate([]int{15, -73, 14, -15}), expected: 1 },
     { actual: candidate([]int{33, -2, -3, 45, 21, 109}), expected: 2 },
     { actual: candidate([]int{43, -12, 93, 125, 121, 109}), expected: 4 },
     { actual: candidate([]int{71, -2, -33, 75, 21, 19}), expected: 3 },
     { actual: candidate([]int{1}), expected: 0 },
     { actual: candidate([]int{}), 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 sum_to_n_test

import (
    "testing"
    "fmt"
)

// sum_to_n is a function that sums numbers from 1 to n.
// >>> sum_to_n(30)
// 465
// >>> sum_to_n(100)
// 5050
// >>> sum_to_n(5)
// 15
// >>> sum_to_n(10)
// 55
// >>> sum_to_n(1)
// 1
func sum_to_n(n int) int {

func TestSum_To_N(t *testing.T) {
  candidate := sum_to_n
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(1), expected: 1 },
     { actual: candidate(6), expected: 21 },
     { actual: candidate(11), expected: 66 },
     { actual: candidate(30), expected: 465 },
     { actual: candidate(100), expected: 5050 },
   }

	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 remove_duplicates_test

import (
    "testing"
    "fmt"
)

// From a list of integers, remove all elements that occur more than once.
// Keep order of elements left the same as in the input.
// >>> remove_duplicates([]int{1, 2, 3, 2, 4})
// []int{1, 3, 4}
func remove_duplicates(numbers []int) []int {

func TestRemove_Duplicates(t *testing.T) {
  candidate := remove_duplicates
	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{1, 2, 3, 2, 4, 3, 5}), expected: []int{1, 4, 5} },
   }

	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 generate_integers_test

import (
    "testing"
    "fmt"
)

// Given two positive integers a and b, return the even digits between a
// and b, in ascending order.
// For example:
// >>> generate_integers(2, 8)
// []int{2, 4, 6, 8}
// >>> generate_integers(8, 2)
// []int{2, 4, 6, 8}
// >>> generate_integers(10, 14)
// []int{}
func generate_integers(a int, b int) []int {

func TestGenerate_Integers(t *testing.T) {
  candidate := generate_integers
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate(2, 10), expected: []int{2, 4, 6, 8} },
     { actual: candidate(10, 2), expected: []int{2, 4, 6, 8} },
     { actual: candidate(132, 2), expected: []int{2, 4, 6, 8} },
     { actual: candidate(17, 89), expected: []int{} },
   }

	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)
			}
		})
	}
}