Skip to content

Commit

Permalink
Merge pull request #2 from dominikwinter/1-fix-installation-problems
Browse files Browse the repository at this point in the history
fix installation problems
  • Loading branch information
dominikwinter authored Jan 25, 2024
2 parents a750f74 + 9d4fb36 commit 3a8cf13
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
.PHONY: default b build i install r release
.PHONY: default t test b build i install c clean r release

default: build

t test:
go test -v

b build:
go build

i install:
go install

c clean:
go mod tidy

r release:
mkdir -p bin
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o bin/genpno-macos-arm64
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module genpno
module github.com/dominikwinter/genpno

go 1.21.6
32 changes: 32 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"testing"
)

func Test_getRandomDate(t *testing.T) {
date := getRandomDate()

if l := len(date); l != 8 {
t.Errorf("Date is not 8 characters long, but %d", l)
}
}

func Test_getRandomThreeDigits(t *testing.T) {
three := getRandomThreeDigits(true)

if l := len(three); l != 3 {
t.Errorf("Three is not 3 characters long, but %d", l)
}
}

func Test_getChecksum(t *testing.T) {
date := "19800101"
three := "123"

checksum := getChecksum(&date, &three)

if l := len(checksum); l != 1 {
t.Errorf("Checksum is not 2 characters long, but %d", l)
}
}

0 comments on commit 3a8cf13

Please sign in to comment.