Skip to content

Commit

Permalink
Fix Angle base branch test and fix ConVar tests
Browse files Browse the repository at this point in the history
This was apparently fixed
I also apparently fked up in some convar tests
  • Loading branch information
RaphaelIT7 committed Sep 21, 2024
1 parent 05e968d commit 4a83030
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
8 changes: 4 additions & 4 deletions lua/tests/gmod/classes/convar/GetFlags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ return {
name = "FCVAR_AVAILABLE2 is present (x86-64)",
when = IS_64BIT_BRANCH,
func = function()
local = GetTestConVar()
local flags = a:Flags()
local a = GetTestConVar()
local flags = a:GetFlags()

expect( bit.band( flags, FCVAR_AVAILABLE2 ) ).to.equal( FCVAR_AVAILABLE2 )
end
Expand All @@ -72,8 +72,8 @@ return {
name = "FCVAR_AVAILABLE2 is not present (base)",
when = IS_BASE_BRANCH,
func = function()
local = GetTestConVar()
local flags = a:Flags()
local a = GetTestConVar()
local flags = a:GetFlags()

expect( bit.band( flags, FCVAR_AVAILABLE2 ) ).toNot.equal( FCVAR_AVAILABLE2 )
end
Expand Down
10 changes: 4 additions & 6 deletions lua/tests/gmod/classes/convar/IsFlagSet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,19 @@ return {
name = "FCVAR_AVAILABLE2 is present (x86-64)",
when = IS_64BIT_BRANCH,
func = function()
local = GetTestConVar()
local flags = a:Flags()
local a = GetTestConVar()

expect( bit.band( flags, FCVAR_AVAILABLE2 ) ).to.equal( FCVAR_AVAILABLE2 )
expect( a:IsFlagSet( FCVAR_AVAILABLE2 ) ).to.beTrue()
end
},

{
name = "FCVAR_AVAILABLE2 is not present (base)",
when = IS_BASE_BRANCH,
func = function()
local = GetTestConVar()
local flags = a:Flags()
local a = GetTestConVar()

expect( bit.band( flags, FCVAR_AVAILABLE2 ) ).toNot.equal( FCVAR_AVAILABLE2 )
expect( a:IsFlagSet( FCVAR_AVAILABLE2 ) ).to.beFalse()
end
},
}
Expand Down
26 changes: 2 additions & 24 deletions lua/tests/gmod/globals/angle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,7 @@ return {
end
},{
-- https://github.com/Facepunch/garrysmod-issues/issues/5922#issuecomment-2194156039
name = "Nil pitch returns 0, 0, 0 (base)",
when = IS_BASE_BRANCH,
func = function()
local angle = Angle( nil, 10, 22 )
expect( angle.pitch ).to.equal( 0 )
expect( angle.yaw ).to.equal( 0 )
expect( angle.roll ).to.equal( 0 )
end
},{
-- https://github.com/Facepunch/garrysmod-issues/issues/5922#issuecomment-2194156039
name = "Nil pitch falls back to 0 (x86-64)",
when = IS_64BIT_BRANCH,
name = "Nil pitch falls back to 0",
func = function()
local angle = Angle( nil, 10, 22 )
expect( angle.pitch ).to.equal( 0 )
Expand All @@ -96,18 +85,7 @@ return {
end
},{
-- https://github.com/Facepunch/garrysmod-issues/issues/5922#issuecomment-2194156039
name = "Table pitch returns 0, 0, 0 (base)",
when = IS_BASE_BRANCH,
func = function()
local angle = Angle( { "test" }, 10, 22 )
expect( angle.pitch ).to.equal( 0 )
expect( angle.yaw ).to.equal( 0 )
expect( angle.roll ).to.equal( 0 )
end
},{
-- https://github.com/Facepunch/garrysmod-issues/issues/5922#issuecomment-2194156039
name = "Table pitch falls back to 0 (x86-64)",
when = IS_64BIT_BRANCH,
name = "Table pitch falls back to 0",
func = function()
local angle = Angle( { "test" }, 10, 22 )
expect( angle.pitch ).to.equal( 0 )
Expand Down

0 comments on commit 4a83030

Please sign in to comment.