You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
460 B

package main
import (
"os"
"os/exec"
"../../lib"
)
var name = "student"
func test(newName string) {
if err := os.Rename(name, newName); err != nil {
lib.Fatalln(err)
}
b, err := exec.Command("./" + name).CombinedOutput()
if err != nil {
lib.Fatalln(b)
}
if string(b) != name+"\n" {
lib.Fatalln("Failed to print the program name")
}
name = newName
}
func main() {
test("student")
test("choumi")
test("🤦🏻")
test("€")
}