mirror of
				https://github.com/onyx-and-iris/voicemeeter.git
				synced 2025-11-04 15:41:51 +00:00 
			
		
		
		
	now using testify/assert
added helper_test dependencies updated in go.mod file
This commit is contained in:
		
							parent
							
								
									507a1c6b00
								
							
						
					
					
						commit
						e868bf2ef0
					
				
							
								
								
									
										11
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								go.mod
									
									
									
									
									
								
							@ -2,4 +2,13 @@ module github.com/onyx-and-iris/voicemeeter-api-go
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
go 1.18
 | 
					go 1.18
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664
 | 
					require (
 | 
				
			||||||
 | 
						github.com/stretchr/testify v1.7.5
 | 
				
			||||||
 | 
						golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require (
 | 
				
			||||||
 | 
						github.com/davecgh/go-spew v1.1.1 // indirect
 | 
				
			||||||
 | 
						github.com/pmezard/go-difflib v1.0.0 // indirect
 | 
				
			||||||
 | 
						gopkg.in/yaml.v3 v3.0.1 // indirect
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										15
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								go.sum
									
									
									
									
									
								
							@ -1,2 +1,17 @@
 | 
				
			|||||||
 | 
					github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
 | 
					github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 | 
				
			||||||
 | 
					github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
 | 
					github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 | 
				
			||||||
 | 
					github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
				
			||||||
 | 
					github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
 | 
					github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 | 
				
			||||||
 | 
					github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
				
			||||||
 | 
					github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q=
 | 
				
			||||||
 | 
					github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 h1:wEZYwx+kK+KlZ0hpvP2Ls1Xr4+RWnlzGFwPP0aiDjIU=
 | 
					golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 h1:wEZYwx+kK+KlZ0hpvP2Ls1Xr4+RWnlzGFwPP0aiDjIU=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
 | 
					gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 | 
				
			||||||
 | 
					gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										19
									
								
								tests/helper_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								tests/helper_test.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					package voicemeeter_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/onyx-and-iris/voicemeeter-api-go/voicemeeter"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var (
 | 
				
			||||||
 | 
						vmRem = voicemeeter.NewRemote("banana")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestMain(m *testing.M) {
 | 
				
			||||||
 | 
						vmRem.Login()
 | 
				
			||||||
 | 
						code := m.Run()
 | 
				
			||||||
 | 
						vmRem.Logout()
 | 
				
			||||||
 | 
						os.Exit(code)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,91 +1,125 @@
 | 
				
			|||||||
package voicemeeter_test
 | 
					package voicemeeter_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"os"
 | 
					 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/onyx-and-iris/voicemeeter-api-go/voicemeeter"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					 | 
				
			||||||
	vmRem = voicemeeter.NewRemote("banana")
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestMain(m *testing.M) {
 | 
					 | 
				
			||||||
	vmRem.Login()
 | 
					 | 
				
			||||||
	code := m.Run()
 | 
					 | 
				
			||||||
	vmRem.Logout()
 | 
					 | 
				
			||||||
	os.Exit(code)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestStrip0Mute(t *testing.T) {
 | 
					func TestStrip0Mute(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Strip[0].SetMute(true)
 | 
						vmRem.Strip[0].SetMute(true)
 | 
				
			||||||
	if vmRem.Strip[0].GetMute() != true {
 | 
						t.Run("Should return true when SetMute(true)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestStrip0Mute did not match true")
 | 
							assert.Equal(t, vmRem.Strip[0].GetMute(), true)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Strip[0].SetMute(false)
 | 
				
			||||||
 | 
						t.Run("Should return false when SetMute(false)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Strip[0].GetMute(), false)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestStrip2Limit(t *testing.T) {
 | 
					func TestStrip2Limit(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Strip[2].SetLimit(-8)
 | 
						vmRem.Strip[2].SetLimit(-8)
 | 
				
			||||||
	if vmRem.Strip[2].GetLimit() != -8 {
 | 
						t.Run("Should return -8 when SetLimit(-8)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestStrip3Limit did not match -8")
 | 
							assert.Equal(t, vmRem.Strip[2].GetLimit(), -8)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Strip[2].SetLimit(-32)
 | 
				
			||||||
 | 
						t.Run("Should return -32 when SetLimit(-8)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Strip[2].GetLimit(), -32)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestStrip4Label(t *testing.T) {
 | 
					func TestStrip4Label(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Strip[4].SetLabel("test0")
 | 
						vmRem.Strip[4].SetLabel("test0")
 | 
				
			||||||
	if vmRem.Strip[4].GetLabel() != "test0" {
 | 
						t.Run("Should return test0 when SetLimit('test0')", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestStrip4Label did not match test0")
 | 
							assert.Equal(t, vmRem.Strip[4].GetLabel(), "test0")
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Strip[4].SetLabel("test1")
 | 
				
			||||||
 | 
						t.Run("Should return test1 when SetLimit('test1')", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Strip[4].GetLabel(), "test1")
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestStrip5Gain(t *testing.T) {
 | 
					func TestStrip5Gain(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Strip[4].SetGain(-20.8)
 | 
						vmRem.Strip[4].SetGain(-20.8)
 | 
				
			||||||
	if vmRem.Strip[4].GetGain() != -20.8 {
 | 
						t.Run("Should return -20.8 when SetGain(-20.8)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestStrip5Gain did not match -20.8")
 | 
							assert.Equal(t, vmRem.Strip[4].GetGain(), -20.8)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Strip[4].SetGain(-3.6)
 | 
				
			||||||
 | 
						t.Run("Should return -3.6 when SetGain(-3.6)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Strip[4].GetGain(), -3.6)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestStrip3Mc(t *testing.T) {
 | 
					func TestStrip3Mc(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Strip[3].SetMc(true)
 | 
						vmRem.Strip[3].SetMc(true)
 | 
				
			||||||
	if vmRem.Strip[3].GetMc() != true {
 | 
						t.Run("Should return true when SetMc(true)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestStrip3Mc did not match true")
 | 
							assert.Equal(t, vmRem.Strip[3].GetMc(), true)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Strip[3].SetMc(false)
 | 
				
			||||||
 | 
						t.Run("Should return false when SetMc(false)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Strip[3].GetMc(), false)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestBus3Eq(t *testing.T) {
 | 
					func TestBus3Eq(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Bus[0].SetEq(true)
 | 
						vmRem.Bus[3].SetEq(true)
 | 
				
			||||||
	if vmRem.Bus[0].GetEq() != true {
 | 
						t.Run("Should return true when SetEq(true)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestBus3Eq did not match true")
 | 
							assert.Equal(t, vmRem.Bus[3].GetEq(), true)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Bus[3].SetEq(false)
 | 
				
			||||||
 | 
						t.Run("Should return false when SetEq(false)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Bus[3].GetEq(), false)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestBus4Label(t *testing.T) {
 | 
					func TestBus4Label(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Bus[4].SetLabel("test0")
 | 
						vmRem.Bus[4].SetLabel("test0")
 | 
				
			||||||
	if vmRem.Bus[4].GetLabel() != "test0" {
 | 
						t.Run("Should return test0 when SetEq('test0')", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestBus4Label did not match test0")
 | 
							assert.Equal(t, vmRem.Bus[4].GetLabel(), "test0")
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Bus[4].SetLabel("test1")
 | 
				
			||||||
 | 
						t.Run("Should return test1 when SetEq('test1')", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Bus[4].GetLabel(), "test1")
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestVbanInStream0On(t *testing.T) {
 | 
					func TestVbanInStream0On(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Vban.InStream[0].SetOn(true)
 | 
						vmRem.Vban.InStream[0].SetOn(true)
 | 
				
			||||||
	if vmRem.Vban.InStream[0].GetOn() != true {
 | 
						t.Run("Should return true when SetOn(true)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestVbanInStream0On did not match true")
 | 
							assert.Equal(t, vmRem.Vban.InStream[0].GetOn(), true)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Vban.InStream[0].SetOn(false)
 | 
				
			||||||
 | 
						t.Run("Should return false when SetOn(false)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Vban.InStream[0].GetOn(), false)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestVbanOutStream6On(t *testing.T) {
 | 
					func TestVbanOutStream6On(t *testing.T) {
 | 
				
			||||||
	//t.Skip("skipping test")
 | 
						//t.Skip("skipping test")
 | 
				
			||||||
	vmRem.Vban.OutStream[6].SetOn(true)
 | 
						vmRem.Vban.OutStream[6].SetOn(true)
 | 
				
			||||||
	if vmRem.Vban.OutStream[6].GetOn() != true {
 | 
						t.Run("Should return true when SetOn(true)", func(t *testing.T) {
 | 
				
			||||||
		t.Error("TestVbanOutStream6On did not match true")
 | 
							assert.Equal(t, vmRem.Vban.OutStream[6].GetOn(), true)
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						vmRem.Vban.OutStream[6].SetOn(false)
 | 
				
			||||||
 | 
						t.Run("Should return false when SetOn(false)", func(t *testing.T) {
 | 
				
			||||||
 | 
							assert.Equal(t, vmRem.Vban.OutStream[6].GetOn(), false)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user