21 lines
402 B
Go
21 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestZigZagConvert3(t *testing.T) {
|
|
input := "PAYPALISHIRING"
|
|
expected := "PAHNAPLSIIGYIR"
|
|
res := ZigZagConvert(input, 3)
|
|
assert.Equal(t, expected, res)
|
|
}
|
|
|
|
func TestZigZagConvert4(t *testing.T) {
|
|
input := "PAYPALISHIRING"
|
|
expected := "PINALSIGYAHRPI"
|
|
res := ZigZagConvert(input, 4)
|
|
assert.Equal(t, expected, res)
|
|
}
|