File: type_test.go

package info (click to toggle)
miller 6.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 88,244 kB
  • sloc: ruby: 162; sh: 120; makefile: 87; python: 46
file content (18 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package scan

import (
	"testing"

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

func TestTypeNames(t *testing.T) {
	assert.Equal(t, TypeNames[scanTypeString], "string")
	assert.Equal(t, TypeNames[scanTypeDecimalInt], "decint")
	assert.Equal(t, TypeNames[scanTypeLeadingZeroDecimalInt], "lzdecint") // e.g. 0899
	assert.Equal(t, TypeNames[scanTypeOctalInt], "octint")                // e.g. 0o377
	assert.Equal(t, TypeNames[scanTypeLeadingZeroOctalInt], "lzoctint")   // e.g. 0377
	assert.Equal(t, TypeNames[scanTypeHexInt], "hexint")                  // e.g. 0xcafe
	assert.Equal(t, TypeNames[scanTypeBinaryInt], "binint")               // e.g. 0b1011
	assert.Equal(t, TypeNames[scanTypeMaybeFloat], "float?")              // characters in [0-9\.-+eE] but needs parse to be sure
}