Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update infrastructure #238

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
cache: true
go-version-file: go.mod
Expand All @@ -29,8 +29,8 @@ jobs:
darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
cache: true
go-version-file: go.mod
Expand All @@ -41,8 +41,8 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
cache: true
go-version-file: go.mod
Expand All @@ -53,12 +53,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: actions/setup-go@b22fbbc2921299758641fab08929b4ac52b32923
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
cache: true
go-version-file: go.mod
- uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc
- uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
with:
version: v${{ env.GOLANGCI_LINT_VERSION }}
- name: format
Expand Down
6 changes: 3 additions & 3 deletions bigxy/big_cga_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"testing"

"github.com/stretchr/testify/require"
"github.com/alecthomas/assert/v2"

"github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/bigxy"
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestOrientationIndex(t *testing.T) {
} {
t.Run(strconv.Itoa(i), func(t *testing.T) {
orientationIndex := bigxy.OrientationIndex(testData.vectorOrigin, testData.vectorEnd, testData.point)
require.Equal(t, testData.result, orientationIndex)
assert.Equal(t, testData.result, orientationIndex)
})
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestIntersection(t *testing.T) {
} {
t.Run(tc.desc, func(t *testing.T) {
calculatedIntersection := bigxy.Intersection(tc.line1Start, tc.line1End, tc.line2Start, tc.line2End)
require.Equal(t, tc.result, calculatedIntersection)
assert.Equal(t, tc.result, calculatedIntersection)
})
}
}
2 changes: 1 addition & 1 deletion bounds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"
"testing"

"github.com/stretchr/testify/assert"
"github.com/alecthomas/assert/v2"
)

func TestBoundsExtend(t *testing.T) {
Expand Down
74 changes: 37 additions & 37 deletions encoding/ewkb/ewkb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/require"
"github.com/alecthomas/assert/v2"

"github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/internal/geomtest"
Expand All @@ -16,29 +16,29 @@ func test(t *testing.T, g geom.T, xdr, ndr []byte) {
t.Run("xdr", func(t *testing.T) {
t.Run("unmarshal", func(t *testing.T) {
got, err := Unmarshal(xdr)
require.NoError(t, err)
require.Equal(t, g, got)
assert.NoError(t, err)
assert.Equal(t, g, got)
})

t.Run("marshal", func(t *testing.T) {
got, err := Marshal(g, XDR)
require.NoError(t, err)
require.Equal(t, xdr, got)
assert.NoError(t, err)
assert.Equal(t, xdr, got)
})
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
t.Run("unmarshal", func(t *testing.T) {
got, err := Unmarshal(ndr)
require.NoError(t, err)
require.Equal(t, g, got)
assert.NoError(t, err)
assert.Equal(t, g, got)
})

t.Run("marshal", func(t *testing.T) {
got, err := Marshal(g, NDR)
require.NoError(t, err)
require.Equal(t, ndr, got)
assert.NoError(t, err)
assert.Equal(t, ndr, got)
})
})
}
Expand All @@ -48,98 +48,98 @@ func test(t *testing.T, g geom.T, xdr, ndr []byte) {
var p Point
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, p.Scan(xdr))
require.Equal(t, Point{g}, p)
assert.NoError(t, p.Scan(xdr))
assert.Equal(t, Point{g}, p)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, p.Scan(ndr))
require.Equal(t, Point{g}, p)
assert.NoError(t, p.Scan(ndr))
assert.Equal(t, Point{g}, p)
})
}
case *geom.LineString:
var ls LineString
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, ls.Scan(xdr))
require.Equal(t, LineString{g}, ls)
assert.NoError(t, ls.Scan(xdr))
assert.Equal(t, LineString{g}, ls)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, ls.Scan(ndr))
require.Equal(t, LineString{g}, ls)
assert.NoError(t, ls.Scan(ndr))
assert.Equal(t, LineString{g}, ls)
})
}
case *geom.Polygon:
var p Polygon
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, p.Scan(xdr))
require.Equal(t, Polygon{g}, p)
assert.NoError(t, p.Scan(xdr))
assert.Equal(t, Polygon{g}, p)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, p.Scan(ndr))
require.Equal(t, Polygon{g}, p)
assert.NoError(t, p.Scan(ndr))
assert.Equal(t, Polygon{g}, p)
})
}
case *geom.MultiPoint:
var mp MultiPoint
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, mp.Scan(xdr))
require.Equal(t, MultiPoint{g}, mp)
assert.NoError(t, mp.Scan(xdr))
assert.Equal(t, MultiPoint{g}, mp)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, mp.Scan(ndr))
require.Equal(t, MultiPoint{g}, mp)
assert.NoError(t, mp.Scan(ndr))
assert.Equal(t, MultiPoint{g}, mp)
})
}
case *geom.MultiLineString:
var mls MultiLineString
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, mls.Scan(xdr))
require.Equal(t, MultiLineString{g}, mls)
assert.NoError(t, mls.Scan(xdr))
assert.Equal(t, MultiLineString{g}, mls)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, mls.Scan(ndr))
require.Equal(t, MultiLineString{g}, mls)
assert.NoError(t, mls.Scan(ndr))
assert.Equal(t, MultiLineString{g}, mls)
})
}
case *geom.MultiPolygon:
var mp MultiPolygon
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, mp.Scan(xdr))
require.Equal(t, MultiPolygon{g}, mp)
assert.NoError(t, mp.Scan(xdr))
assert.Equal(t, MultiPolygon{g}, mp)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, mp.Scan(ndr))
require.Equal(t, MultiPolygon{g}, mp)
assert.NoError(t, mp.Scan(ndr))
assert.Equal(t, MultiPolygon{g}, mp)
})
}
case *geom.GeometryCollection:
var gc GeometryCollection
if xdr != nil {
t.Run("xdr", func(t *testing.T) {
require.NoError(t, gc.Scan(xdr))
require.Equal(t, GeometryCollection{g}, gc)
assert.NoError(t, gc.Scan(xdr))
assert.Equal(t, GeometryCollection{g}, gc)
})
}
if ndr != nil {
t.Run("ndr", func(t *testing.T) {
require.NoError(t, gc.Scan(ndr))
require.Equal(t, GeometryCollection{g}, gc)
assert.NoError(t, gc.Scan(ndr))
assert.Equal(t, GeometryCollection{g}, gc)
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions encoding/ewkb/postgis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"database/sql"
"testing"

"github.com/alecthomas/assert/v2"
_ "github.com/lib/pq"
"github.com/stretchr/testify/require"

"github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/encoding/ewkb"
Expand Down Expand Up @@ -48,5 +48,5 @@ func TestPostGIS(t *testing.T) {
if err := db.QueryRow("SELECT ST_AsEWKB(geom) FROM testgeoms WHERE ST_Within(geom, $1);", queryP).Scan(&p); err != nil {
t.Fatalf("db.QueryRow(...).Scan(...) == %v, want <nil>", err)
}
require.Equal(t, [][]geom.Coord{{{5, 3}, {5, 0}, {7, 0}, {7, 3}, {5, 3}}}, p.Coords())
assert.Equal(t, [][]geom.Coord{{{5, 3}, {5, 0}, {7, 0}, {7, 3}, {5, 3}}}, p.Coords())
}
12 changes: 6 additions & 6 deletions encoding/ewkb/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"testing"

"github.com/stretchr/testify/require"
"github.com/alecthomas/assert/v2"

"github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/internal/geomtest"
Expand Down Expand Up @@ -45,12 +45,12 @@ func TestPointScanAndValue(t *testing.T) {
} {
t.Run(strconv.Itoa(i), func(t *testing.T) {
var gotPoint Point
require.NoError(t, gotPoint.Scan(tc.value))
require.Equal(t, tc.point, gotPoint)
require.Equal(t, tc.valid, gotPoint.Valid())
assert.NoError(t, gotPoint.Scan(tc.value))
assert.Equal(t, tc.point, gotPoint)
assert.Equal(t, tc.valid, gotPoint.Valid())
gotValue, gotErr := tc.point.Value()
require.NoError(t, gotErr)
require.Equal(t, tc.value, gotValue)
assert.NoError(t, gotErr)
assert.Equal(t, tc.value, gotValue)
})
}
}
Loading