Skip to content

Commit

Permalink
improve tests and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
thevilledev committed May 18, 2023
1 parent 67e58a9 commit 753c636
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Go package

on:
push:
tags:
- '*'
branches:
- main
workflow_dispatch:
inputs:
branch:

jobs:
build:
Expand Down
42 changes: 42 additions & 0 deletions thespine_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,51 @@
package thespine

import (
"fmt"
"log"
"testing"
)

func ExampleDecode() {
str := "nespithe"
o, err := Decode(str)
if err != nil {
log.Fatal(err)
}
fmt.Println(o)
// Output: thespine
}

func ExampleDecodeText() {
str := "nespithe erecshyrinol"
o, err := DecodeText(str)
if err != nil {
log.Fatal(err)
}
fmt.Println(o)
// Output: thespine nolyricshere
}

func ExampleEncode() {
str := "nolyricshere"
o, err := EncodeText(str)
if err != nil {
log.Fatal(err)
}
fmt.Println(o)
// Output: erecshyrinol
}

func ExampleEncodeText() {
str := "nolyricshere thespine"
o, err := EncodeText(str)
if err != nil {
log.Fatal(err)
}
fmt.Println(o)
// Output: erecshyrinol nespithe
}

func Test_Decode(t *testing.T) {
tests := []struct {
str string
Expand Down

0 comments on commit 753c636

Please sign in to comment.