File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Copyright 2022 ChainSafe Systems (ON)
2+ // SPDX-License-Identifier: LGPL-3.0-only
3+
4+ package wasmer
5+
6+ import (
7+ "testing"
8+
9+ "github.com/ChainSafe/gossamer/lib/runtime"
10+ "github.com/stretchr/testify/assert"
11+ "github.com/stretchr/testify/require"
12+ )
13+
14+ func Test_Config_SetTestVersion (t * testing.T ) {
15+ t .Run ("panics with nil *testing.T" , func (t * testing.T ) {
16+ var c Config
17+ assert .PanicsWithValue (t ,
18+ "*testing.T argument cannot be nil. Please don't use this function outside of Go tests." ,
19+ func () {
20+ c .SetTestVersion (nil , runtime.Version {})
21+ })
22+ })
23+
24+ t .Run ("set test version" , func (t * testing.T ) {
25+ var c Config
26+ testVersion := runtime.Version {
27+ StateVersion : 1 ,
28+ }
29+
30+ c .SetTestVersion (t , testVersion )
31+
32+ require .NotNil (t , c .testVersion )
33+ assert .Equal (t , testVersion , * c .testVersion )
34+ })
35+ }
You can’t perform that action at this time.
0 commit comments