File: internal_test.go

package info (click to toggle)
golang-github-lestrrat-go-strftime 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 180 kB
  • sloc: makefile: 24
file content (32 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package strftime

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestCombine(t *testing.T) {
	{
		s, err := New(`%A foo`)
		if !assert.NoError(t, err, `New should succeed`) {
			return
		}

		if !assert.Equal(t, 1, len(s.compiled), "there are 1 element") {
			return
		}
	}
	{
		s, _ := New(`%A 100`)
		if !assert.Equal(t, 2, len(s.compiled), "there are two elements") {
			return
		}
	}
	{
		s, _ := New(`%A Mon`)
		if !assert.Equal(t, 2, len(s.compiled), "there are two elements") {
			return
		}
	}
}