Files
gists/projects/go-tools/goipgrep/internal/normalize/mac_test.go
T
tobias 1cbf8afb4a chore: cleanup — untrack binaries, consolidate Go dirs, dedupe tools
- Untrack and delete compiled binaries (tarsum, gosoft.exe, rust uniq/uniq2);
  ignore build outputs (dist/, bin/, *.exe, *.test, .ruff_cache/)
- Merge tools/go/ and projects/go-tools/go/ into projects/go-tools/<name>/
- Fix goipgrep .gitignore: bare 'ipgrep' pattern was ignoring cmd/ipgrep/,
  so the main entrypoint was never tracked; now anchored to /ipgrep
- Archive duplicate implementations to archive/experimental/{rust,go}/
  (uniq, between, tarsum rewrites); canonical versions stay in tools/
- Update README tool catalog to match new layout

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 13:42:45 +02:00

24 lines
527 B
Go

package normalize
import "testing"
func TestNormalizeMAC(t *testing.T) {
cases := map[string]string{
"AA:BB:CC:DD:EE:FF": "aa:bb:cc:dd:ee:ff",
"aa-bb-cc-dd-ee-ff": "aa:bb:cc:dd:ee:ff",
"aabb.ccdd.eeff": "aa:bb:cc:dd:ee:ff",
}
for in, want := range cases {
got, ok := NormalizeMAC(in)
if !ok {
t.Fatalf("NormalizeMAC(%q) not ok", in)
}
if got != want {
t.Fatalf("NormalizeMAC(%q)=%q want %q", in, got, want)
}
}
if _, ok := NormalizeMAC("not-a-mac"); ok {
t.Fatalf("expected invalid mac")
}
}