From 76d6ab6be4a72335990f78c2b243f472dc4ee9a3 Mon Sep 17 00:00:00 2001 From: liujian Date: Mon, 6 Nov 2023 11:29:21 +0800 Subject: [PATCH] Update xdi --- src/xdi/container_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xdi/container_test.go b/src/xdi/container_test.go index af39ed2..c44b4c2 100644 --- a/src/xdi/container_test.go +++ b/src/xdi/container_test.go @@ -61,10 +61,10 @@ func TestPopulate(t *testing.T) { // 错误使用测试 var f3 foo err := c.Populate("foo", f3) // 非指针 - a.Contains(err.Error(), "can only be pointer type") + a.Contains(err.Error(), "argument can only be pointer type") var f4 foo - err = c.Populate("foo", &f4) // New函数返回的指针,但是f3为引用 [panic: reflect.Set: value of type *xdi.foo is not assignable to type xdi.foo] - a.Contains(err.Error(), "is not assignable to") + err = c.Populate("foo", &f4) // New函数返回的指针,但是f4为引用 [panic: reflect.Set: value of type *xdi.foo is not assignable to type xdi.foo] + a.Contains(err.Error(), "value of type *xdi.foo is not assignable to type xdi.foo") // 测试嵌套依赖 var f *foo