package main

import "testing"

func TestFibonacci(t *testing.T) {
	tcs := map[string]struct {
		n        int
		expected int
	}{
		"n = 1":   {1, 1},
		"n = 2":   {2, 1},
		"n = 50":  {50, 12586269025},
		"n = 200": {200, 280571172992510140037611932413038677189525},
	}

	for name, tc := range tcs {
		t.Run(name, func(t *testing.T) {
			res := fib(tc.n)
			if res != tc.expected {
				t.Fatalf("want %v, got %v\n", tc.expected, res)
			}
		})
	}
}

package main

import (
	"math/big"
	"testing"
)

func TestFibonacci(t *testing.T) {
	tcs := map[string]struct {
		n        int
		expected string //Use string to allow for values that overflow an int64
	}{
		"n = 0":   {0, "0"},
		"n = 1":   {1, "1"},
		"n = 2":   {2, "1"},
		"n = 50":  {50, "12586269025"},
		"n = 100": {100, "354224848179261915075"},
		"n = 200": {200, "280571172992510140037611932413038677189525"},
	}

	for name, tc := range tcs {
		t.Run(name, func(t *testing.T) {
			expected, ok := big.NewInt(0).SetString(tc.expected, 10)
			if !ok {
				t.Fatalf("Bad expected value in test case: %s", tc.expected)
			}
			res := fib(tc.n)
			if res != expected {
				t.Fatalf("want %v, got %v\n", tc.expected, res)
			}
		})
	}
}

Change expected value in test cases to string to allow for values that don't fit in an int64
Change expected value in test cases to string to allow for values that don't fit in an int64
