Sha256: e2e154e5adce1264f3e38a60560a21f085d6a880276abcd4e2ffa5f67f114587

Contents?: true

Size: 806 Bytes

Versions: 99

Compression:

Stored size: 806 Bytes

Contents

package acronym

import (
	"testing"
)

const targetTestVersion = 2

type testCase struct {
	input    string
	expected string
}

var stringTestCases = []testCase{
	{"Portable Network Graphics", "PNG"},
	{"HyperText Markup Language", "HTML"},
	{"Ruby on Rails", "ROR"},
	{"PHP: Hypertext Preprocessor", "PHP"},
	{"First In, First Out", "FIFO"},
	{"Complementary metal-oxide semiconductor", "CMOS"},
}

func TestTestVersion(t *testing.T) {
	if testVersion != targetTestVersion {
		t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
	}
}

func TestAcronym(t *testing.T) {
	for _, test := range stringTestCases {
		actual := Abbreviate(test.input)
		if actual != test.expected {
			t.Errorf("Acronym test [%s], expected [%s], actual [%s]", test.input, test.expected, actual)
		}
	}
}

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
trackler-2.1.0.27 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.26 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.25 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.24 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.23 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.22 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.21 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.20 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.19 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.18 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.17 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.16 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.15 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.14 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.13 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.12 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.11 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.10 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.9 tracks/go/exercises/acronym/acronym_test.go
trackler-2.1.0.8 tracks/go/exercises/acronym/acronym_test.go