mirror of https://github.com/01-edu/public.git
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
537 B
31 lines
537 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"strconv"
|
||
|
"strings"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/01-edu/z01"
|
||
|
)
|
||
|
|
||
|
func TestIsPowerOf2(t *testing.T) {
|
||
|
var args []string
|
||
|
for i := 1; i < 5; i++ {
|
||
|
args = append(args, strconv.Itoa(i))
|
||
|
}
|
||
|
|
||
|
for i := 0; i < 12; i++ {
|
||
|
args = append(args, strconv.Itoa(z01.RandIntBetween(1, 2048)))
|
||
|
}
|
||
|
|
||
|
args = append(args, "1024")
|
||
|
args = append(args, "")
|
||
|
args = append(args, "4096")
|
||
|
args = append(args, "8388608")
|
||
|
|
||
|
for _, v := range args {
|
||
|
z01.ChallengeMainExam(t, strings.Fields(v)...)
|
||
|
}
|
||
|
z01.ChallengeMainExam(t, "1", "2")
|
||
|
}
|