mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-05 11:21:58 -05:00
Merge pull request #10170 from dolthub/angelamayxie-f6c4ebdf
[auto-bump] [no-release-notes] dependency by angelamayxie
This commit is contained in:
@@ -15,5 +15,5 @@
|
||||
package doltversion
|
||||
|
||||
const (
|
||||
Version = "1.78.5"
|
||||
Version = "1.78.6"
|
||||
)
|
||||
|
||||
@@ -61,7 +61,7 @@ require (
|
||||
github.com/dolthub/dolt-mcp v0.2.2
|
||||
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca
|
||||
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
|
||||
github.com/dolthub/go-mysql-server v0.20.1-0.20251202232759-d8c980a04a5d
|
||||
github.com/dolthub/go-mysql-server v0.20.1-0.20251204232424-f6c4ebdf7b68
|
||||
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63
|
||||
github.com/edsrzf/mmap-go v1.2.0
|
||||
github.com/esote/minmaxheap v1.0.0
|
||||
|
||||
@@ -195,8 +195,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
|
||||
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
|
||||
github.com/dolthub/go-icu-regex v0.0.0-20250916051405-78a38d478790 h1:zxMsH7RLiG+dlZ/y0LgJHTV26XoiSJcuWq+em6t6VVc=
|
||||
github.com/dolthub/go-icu-regex v0.0.0-20250916051405-78a38d478790/go.mod h1:F3cnm+vMRK1HaU6+rNqQrOCyR03HHhR1GWG2gnPOqaE=
|
||||
github.com/dolthub/go-mysql-server v0.20.1-0.20251202232759-d8c980a04a5d h1:h+Z/Rr5l5orrdYk/LFESByUXzwYw+vM/vFZ7GyCP3mY=
|
||||
github.com/dolthub/go-mysql-server v0.20.1-0.20251202232759-d8c980a04a5d/go.mod h1:pD0T+xZWBDO5yxHAY9FUqArKvhvw6KYqxRmEk3NfQNw=
|
||||
github.com/dolthub/go-mysql-server v0.20.1-0.20251204232424-f6c4ebdf7b68 h1:J9rzUGgE4ipbdVIXyiYsxEJ4RliSQTw9sBP9HAC5kcQ=
|
||||
github.com/dolthub/go-mysql-server v0.20.1-0.20251204232424-f6c4ebdf7b68/go.mod h1:pD0T+xZWBDO5yxHAY9FUqArKvhvw6KYqxRmEk3NfQNw=
|
||||
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
|
||||
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
|
||||
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=
|
||||
|
||||
@@ -137,11 +137,11 @@ func NewCheck(name, expression string, enforced bool) check {
|
||||
}
|
||||
}
|
||||
|
||||
func (c checkCollection) Copy() CheckCollection {
|
||||
checks := make([]check, len(c.checks))
|
||||
func (c *checkCollection) Copy() CheckCollection {
|
||||
newC := *c
|
||||
newC.checks = make([]check, len(c.checks))
|
||||
for i, check := range c.checks {
|
||||
checks[i] = NewCheck(check.name, check.expression, check.enforced)
|
||||
newC.checks[i] = NewCheck(check.name, check.expression, check.enforced)
|
||||
}
|
||||
|
||||
return &c
|
||||
return &newC
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright 2025 Dolthub, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package schema
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCopy(t *testing.T) {
|
||||
var original = &checkCollection{
|
||||
checks: []check{{"check1", "expr1", true},
|
||||
{"check2", "expr2", false}},
|
||||
}
|
||||
var copy = original.Copy()
|
||||
|
||||
// Assert copy doesn't reuse the same check instances
|
||||
original.checks[0].name = "XXX"
|
||||
original.checks[0].expression = "XXX"
|
||||
original.checks[0].enforced = false
|
||||
original.checks[1].name = "XXX"
|
||||
original.checks[1].expression = "XXX"
|
||||
original.checks[1].enforced = true
|
||||
|
||||
assert.Equal(t, "check1", copy.AllChecks()[0].Name())
|
||||
assert.Equal(t, "expr1", copy.AllChecks()[0].Expression())
|
||||
assert.Equal(t, true, copy.AllChecks()[0].Enforced())
|
||||
assert.Equal(t, "check2", copy.AllChecks()[1].Name())
|
||||
assert.Equal(t, "expr2", copy.AllChecks()[1].Expression())
|
||||
assert.Equal(t, false, copy.AllChecks()[1].Enforced())
|
||||
}
|
||||
Reference in New Issue
Block a user