Skip to content

Commit

Permalink
feat: upgrade ent to v0.14.2 and casbin to v2.103.0 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 authored Feb 25, 2025
1 parent 4657ed9 commit 2e83cbb
Show file tree
Hide file tree
Showing 24 changed files with 1,203 additions and 1,958 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.23.0'

- uses: actions/checkout@v2
- name: Run Unit tests
Expand Down
13 changes: 10 additions & 3 deletions adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ import (

"github.com/casbin/casbin/v2"
"github.com/casbin/casbin/v2/util"
"github.com/casbin/ent-adapter/ent"
"github.com/stretchr/testify/assert"

"github.com/casbin/ent-adapter/ent"
)

func testGetPolicy(t *testing.T, e *casbin.Enforcer, res [][]string) {
myRes := e.GetPolicy()
myRes, err := e.GetPolicy()
if err != nil {
t.Error("Get Policy Error ", err)
}
log.Print("Policy: ", myRes)

if !util.Array2DEquals(res, myRes) {
Expand All @@ -34,7 +38,10 @@ func testGetPolicy(t *testing.T, e *casbin.Enforcer, res [][]string) {
}

func testGetPolicyWithoutOrder(t *testing.T, e *casbin.Enforcer, res [][]string) {
myRes := e.GetPolicy()
myRes, err := e.GetPolicy()
if err != nil {
t.Error("Get Policy Error ", err)
}
log.Print("Policy: ", myRes)

if !arrayEqualsWithoutOrder(myRes, res) {
Expand Down
56 changes: 33 additions & 23 deletions ent/casbinrule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 48 additions & 1 deletion ent/casbinrule/casbinrule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2e83cbb

Please sign in to comment.