From 7adfce823c0b7dd8485bb6a57e8eeebbf509f259 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 18 Aug 2021 21:30:25 -0700 Subject: [PATCH] Remove old test --- .github/workflows/ci.yml | 2 +- tests/macaddr_test.go | 64 ---------------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3af36ea..f44f9d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - run: go build ./... - run: go build ./... working-directory: tests - - run: go test ./... + - run: go test --tags=postgres${{matrix.postgres}} ./... working-directory: tests env: PG_USER: postgres diff --git a/tests/macaddr_test.go b/tests/macaddr_test.go index beae23c..21aef70 100644 --- a/tests/macaddr_test.go +++ b/tests/macaddr_test.go @@ -67,67 +67,3 @@ func TestMacaddr(t *testing.T) { } }) } - -// https://www.postgresql.org/docs/current/datatype-net-types.html#DATATYPE-MACADDR8 -func TestMacaddr8(t *testing.T) { - for _, addr := range []struct { - input string - output string - }{ - { - "08:00:2b:01:02:03:04:05", - "08:00:2b:01:02:03:04:05", - }, - { - "08-00-2b-01-02-03-04-05", - "08:00:2b:01:02:03:04:05", - }, - { - "08002b:0102030405", - "08:00:2b:01:02:03:04:05", - }, - { - "08002b-0102030405", - "08:00:2b:01:02:03:04:05", - }, - { - "0800.2b01.0203.0405", - "08:00:2b:01:02:03:04:05", - }, - { - "0800-2b01-0203-0405", - "08:00:2b:01:02:03:04:05", - }, - { - "08002b01:02030405", - "08:00:2b:01:02:03:04:05", - }, - { - "08002b0102030405", - "08:00:2b:01:02:03:04:05", - }, - } { - addr = addr - t.Run(addr.input, func(t *testing.T) { - var cidr pqtype.Macaddr - if err := db.QueryRow(fmt.Sprintf(`SELECT '%s'::macaddr8`, addr.input)).Scan(&cidr); err != nil { - t.Fatal(err) - } - if diff := cmp.Diff(true, cidr.Valid); diff != "" { - t.Errorf("valid mismatch (-want +got):\n%s", diff) - } - if diff := cmp.Diff(addr.output, cidr.Addr.String()); diff != "" { - t.Errorf("mismatch (-want +got):\n%s", diff) - } - }) - } - t.Run("NULL", func(t *testing.T) { - var cidr pqtype.Macaddr - if err := db.QueryRow(fmt.Sprintf(`SELECT NULL::macaddr8`)).Scan(&cidr); err != nil { - t.Fatal(err) - } - if diff := cmp.Diff(false, cidr.Valid); diff != "" { - t.Errorf("valid mismatch (-want +got):\n%s", diff) - } - }) -}