Prompt:
package rolling_max_test

import (
    "testing"
    "fmt"
)

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

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

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


Prompt:
package below_zero_test

import (
    "testing"
    "fmt"
)

// You're given a list of deposit and withdrawal operations on a bank account that starts with
// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
// at that point function should return true. Otherwise it should return false.
// >>> below_zero([]int{1, 2, 3})
// false
// >>> below_zero([]int{1, 2, -4, 5})
// true
func below_zero(operations []int) bool {

func TestBelow_Zero(t *testing.T) {
  candidate := below_zero
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{}), expected: false },
     { actual: candidate([]int{1, 2, -3, 1, 2, -3}), expected: false },
     { actual: candidate([]int{1, 2, -4, 5, 6}), expected: true },
     { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -4}), expected: false },
     { actual: candidate([]int{1, -1, 2, -2, 5, -5, 4, -5}), expected: true },
     { actual: candidate([]int{1, -2, 2, -2, 5, -5, 4, -4}), 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 search_test

import (
    "testing"
    "fmt"
)

// You are given a non-empty list of positive integers. Return the greatest integer that is greater than
// zero, and has a frequency greater than or equal to the value of the integer itself.
// The frequency of an integer is the number of times it appears in the list.
// If no such a value exist, return -1.
// Examples:
// >>> search([]int{4, 1, 2, 2, 3, 1})
// 2
// >>> search([]int{1, 2, 2, 3, 3, 3, 4, 4, 4})
// 3
// >>> search([]int{5, 5, 4, 4, 4})
// -1
func search(lst []int) int {


Prompt:
package correct_bracketing_test

import (
    "testing"
    "fmt"
)

// brackets is a string of "(" and ")".
// return true if every opening bracket has a corresponding closing bracket.
// >>> correct_bracketing("(")
// false
// >>> correct_bracketing("()")
// true
// >>> correct_bracketing("(()())")
// true
// >>> correct_bracketing(")(()")
// false
func correct_bracketing(brackets string) bool {

func TestCorrect_Bracketing(t *testing.T) {
  candidate := correct_bracketing
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("()"), expected: true },
     { actual: candidate("(()())"), expected: true },
     { actual: candidate("()()(()())()"), expected: true },
     { actual: candidate("()()((()()())())(()()(()))"), expected: true },
     { actual: candidate("((()())))"), expected: false },
     { actual: candidate(")(()"), expected: false },
     { actual: candidate("("), expected: false },
     { actual: candidate("(((("), expected: false },
     { actual: candidate(")"), expected: false },
     { actual: candidate("(()"), expected: false },
     { actual: candidate("()()(()())())(()"), expected: false },
     { actual: candidate("()()(()())()))()"), 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 sort_even_test

import (
    "testing"
    "fmt"
)

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

func TestSort_Even(t *testing.T) {
  candidate := sort_even
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate([]int{1, 2, 3}), expected: []int{1, 2, 3} },
     { actual: candidate([]int{5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}), expected: []int{-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123} },
     { actual: candidate([]int{5, 8, -12, 4, 23, 2, 3, 11, 12, -10}), expected: []int{-12, 8, 3, 4, 5, 2, 12, 11, 23, -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 same_chars_test

import (
    "testing"
    "fmt"
)

// Check if two words have the same characters.
// >>> same_chars("eabcdzzzz", "dddzzzzzzzddeddabc")
// true
// >>> same_chars("abcd", "dddddddabc")
// true
// >>> same_chars("dddddddabc", "abcd")
// true
// >>> same_chars("eabcd", "dddddddabc")
// false
// >>> same_chars("abcd", "dddddddabce")
// false
// >>> same_chars("eabcdzzzz", "dddzzzzzzzddddabc")
// false
func same_chars(s0 string, s1 string) bool {

func TestSame_Chars(t *testing.T) {
  candidate := same_chars
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("eabcdzzzz", "dddzzzzzzzddeddabc"), expected: true },
     { actual: candidate("abcd", "dddddddabc"), expected: true },
     { actual: candidate("dddddddabc", "abcd"), expected: true },
     { actual: candidate("eabcd", "dddddddabc"), expected: false },
     { actual: candidate("abcd", "dddddddabcf"), expected: false },
     { actual: candidate("eabcdzzzz", "dddzzzzzzzddddabc"), expected: false },
     { actual: candidate("aabb", "aaccc"), 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 correct_bracketing_test

import (
    "testing"
    "fmt"
)

// brackets is a string of "<" and ">".
// return true if every opening bracket has a corresponding closing bracket.
// >>> correct_bracketing("<")
// false
// >>> correct_bracketing("<>")
// true
// >>> correct_bracketing("<<><>>")
// true
// >>> correct_bracketing("><<>")
// false
func correct_bracketing(brackets string) bool {

func TestCorrect_Bracketing(t *testing.T) {
  candidate := correct_bracketing
	type test struct {
		actual   interface{}
		expected interface{}
	}
   tests := []test{
     { actual: candidate("<>"), expected: true },
     { actual: candidate("<<><>>"), expected: true },
     { actual: candidate("<><><<><>><>"), expected: true },
     { actual: candidate("<><><<<><><>><>><<><><<>>>"), expected: true },
     { actual: candidate("<<<><>>>>"), expected: false },
     { actual: candidate("><<>"), expected: false },
     { actual: candidate("<"), expected: false },
     { actual: candidate("<<<<"), expected: false },
     { actual: candidate(">"), expected: false },
     { actual: candidate("<<>"), expected: false },
     { actual: candidate("<><><<><>><>><<>"), expected: false },
     { actual: candidate("<><><<><>><>>><>"), 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)
			}
		})
	}
}