@@ -25,6 +25,16 @@ return {
2525 bass .Update ( 1 )
2626 end
2727 },
28+ {
29+ name = " bass.Update() returns a boolean" ,
30+ when = HolyLib_IsModuleEnabled ( " bass" ),
31+ async = true ,
32+ timeout = 2 ,
33+ func = function ()
34+ local ret = bass .Update ()
35+ expect ( ret ).to .beA ( " boolean" )
36+ end
37+ },
2838 {
2939 name = " Calling bass.Update() does not error on one valid and active channel" ,
3040 when = HolyLib_IsModuleEnabled ( " bass" ),
@@ -40,7 +50,8 @@ return {
4050 expect ( errorMsg ).to .beNil ()
4151 expect ( channel :GetState () ).to .equal ( 1 )
4252
43- bass .Update ()
53+ local success = bass .Update ()
54+ expect ( success ).to .beTrue ()
4455 expect ( channel ).toNot .beNil ()
4556 expect ( errorCode ).to .equal ( 0 )
4657 expect ( errorMsg ).to .beNil ()
@@ -51,7 +62,33 @@ return {
5162 end
5263 },
5364 {
54- name = " Calling bass.Update() does not error on one valid and active channel" ,
65+ name = " Calling bass.Update() on an stopped channel is being handled correctly" ,
66+ when = HolyLib_IsModuleEnabled ( " bass" ),
67+ async = true ,
68+ timeout = 2 ,
69+ func = function ()
70+ local filePath = " sound/bass_testsound.wav"
71+ local flags = " noplay"
72+
73+ bass .PlayFile ( filePath , flags , function ( channel , errorCode , errorMsg )
74+ expect ( channel ).toNot .beNil ()
75+ expect ( errorCode ).to .equal ( 0 )
76+ expect ( errorMsg ).to .beNil ()
77+ expect ( channel :GetState () ).to .equal ( 0 )
78+
79+ local success = bass .Update ()
80+ expect ( success ).to .beTrue ()
81+ expect ( channel ).toNot .beNil ()
82+ expect ( errorCode ).to .equal ( 0 )
83+ expect ( errorMsg ).to .beNil ()
84+ expect ( channel :GetState () ).to .equal ( 0 )
85+
86+ done ()
87+ end )
88+ end
89+ },
90+ {
91+ name = " Calling bass.Update() on an paused channel is being handled correctly" ,
5592 when = HolyLib_IsModuleEnabled ( " bass" ),
5693 async = true ,
5794 timeout = 2 ,
@@ -65,11 +102,15 @@ return {
65102 expect ( errorMsg ).to .beNil ()
66103 expect ( channel :GetState () ).to .equal ( 1 )
67104
68- bass .Update ()
105+ channel :Pause ()
106+ expect ( channel :GetState () ).to .beBetween ( 2 , 3 ) -- checking for BASS_ACTIVE_PAUSED (2) or BASS_ACTIVE_PAUSED_DEVICE (3)
107+
108+ local success = bass .Update ()
109+ expect ( success ).to .beTrue ()
69110 expect ( channel ).toNot .beNil ()
70111 expect ( errorCode ).to .equal ( 0 )
71112 expect ( errorMsg ).to .beNil ()
72- expect ( channel :GetState () ).to .equal ( 1 )
113+ expect ( channel :GetState () ).to .beBetween ( 2 , 3 ) -- checking for BASS_ACTIVE_PAUSED (2) or BASS_ACTIVE_PAUSED_DEVICE (3 )
73114
74115 done ()
75116 end )
0 commit comments