pkg.tk-software.de/gotice@v0.4.1-0.20240224130243-6adec687b106/init_test.go (about) 1 // Copyright 2023-2024 Tobias Koch. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 "os" 9 "testing" 10 ) 11 12 func TestInitCommand(t *testing.T) { 13 args := []string{ 14 "param0", 15 "init", 16 } 17 18 tmpd, err := os.MkdirTemp("", "gotice") 19 if err != nil { 20 t.Fatalf("Expected no error, got %s", err) 21 } 22 23 if err := os.Chdir(tmpd); err != nil { 24 t.Fatalf("Expected no error, got %s", err) 25 } 26 27 if err := exec(args); err != nil { 28 t.Errorf("Expected no error, got %s", err) 29 } 30 }