github.com/blend/go-sdk@v1.20220411.3/ex/multi_test.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package ex
     9  
    10  import (
    11  	"fmt"
    12  	"strings"
    13  	"testing"
    14  
    15  	"github.com/blend/go-sdk/assert"
    16  )
    17  
    18  func TestMulti(t *testing.T) {
    19  	it := assert.New(t)
    20  
    21  	ex0 := New(New("hi0"))
    22  	ex1 := New(fmt.Errorf("hi1"))
    23  	ex2 := New("hi2")
    24  
    25  	m := Append(ex0, ex1, ex2)
    26  
    27  	it.True(strings.HasPrefix(m.Error(), `3 errors occurred:`), m.Error()) //todo, make this test more strict
    28  
    29  	it.Len(m.(Multi).WrappedErrors(), 3)
    30  
    31  	it.NotNil(m.(Multi).Unwrap())
    32  }