Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

572 B
Raw Blame
package main

import "testing"

func TestCommandExitStatus(t *testing.T) {
	for _, test := range []struct {
		name string
		args []string
		want int
	}{
		{"help", []string{"--help"}, 0},
		{"unknown flag", []string{"--not-a-piik-option"}, 2},
		{"invalid port", []string{"--port", "invalid"}, 2},
		{"startup failure", []string{"--local", "--link"}, 1},
	} {
		t.Run(test.name, func(t *testing.T) {
			t.Setenv("PIIK_CLIENT_GATE_NO_BROWSER", "true")
			if got := run(test.args); got != test.want {
				t.Fatalf("exit status = %d, want %d", got, test.want)
			}
		})
	}
}