Created
February 23, 2024 21:21
-
-
Save mattford63/1140c4dac1b93299e77329f9b62650dc to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"strings" | |
"testing" | |
) | |
func TestReverse(t *testing.T) { | |
if reverse("abc") != "cba" { | |
t.Fatalf("Reverse doesn't work") | |
} | |
} | |
func TestExample(t *testing.T) { | |
example := `1abc2 | |
apqr3stu8vwx | |
a1b2c3d4e5f | |
treb7uchet` | |
exampleLines := strings.Split(example, "\n") | |
result := calibration(exampleLines) | |
if result != 142 { | |
t.Fatal("Expected result is", result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment