Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Sep 8, 2023
1 parent 127777c commit 82f302e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func Binary(bt roblox.BinaryType, cfg *config.Config, pfx *wine.Prefix, args ...
}
}


if strings.HasPrefix(strings.Join(args, " "), "roblox-player:1") {
args = bootstrapper.ParsePlayerURI(args[0])
} else if strings.HasPrefix(strings.Join(args, " "), "roblox-studio:1") {
Expand Down
4 changes: 2 additions & 2 deletions roblox/bootstrapper/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ParsePlayerURI(launchURI string) (args []string) {
key, val := pair[0], pair[1]

if key == "channel" {
log.Println("Roblox is attempting to set channel to %s from launch URI, ignoring", val)
log.Printf("Roblox is attempting to set channel to %s from launch URI, ignoring", val)

continue
}
Expand Down Expand Up @@ -62,7 +62,7 @@ func ParseStudioURI(launchURI string) (args []string) {
key, val := pair[0], pair[1]

if key == "channel" {
log.Println("Roblox is attempting to set channel to %s from launch URI, ignoring", val)
log.Printf("Roblox is attempting to set channel to %s from launch URI, ignoring", val)

continue
}
Expand Down
10 changes: 2 additions & 8 deletions roblox/bootstrapper/uri_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,17 @@ func TestPlayerURIParsed(t *testing.T) {
"--gloc", "en_us",
"-channel", "Ganesh",
}
channelWant := "Ganesh"

args, channel := ParsePlayerURI(uri)
args := ParsePlayerURI(uri)

for i, val := range args {
if val != argsWant[i] {
t.Fatalf("launch player uri parsing failed, key %s, want key match for %s", val, argsWant[i])
}
}

if channel != channelWant {
t.Fatalf("launch player uri parsing failed, %v, want channel match for %s", channel, channelWant)
}
}

func TestPlayerURIInvalidKey(t *testing.T) {
args, _ := ParsePlayerURI("roblox-player:1+launchmode:play+channel")
args := ParsePlayerURI("roblox-player:1+launchmode:play+channel")

if len(args) == 1 && args[0] != "--app" {
t.Fail()
Expand Down

0 comments on commit 82f302e

Please sign in to comment.