try to use a new formatter for date and decimal

This commit is contained in:
Liu Ming
2017-07-26 17:56:49 +08:00
parent ce73093973
commit d3f14f70d8
9 changed files with 408 additions and 12 deletions

36
format/parse_test.go Normal file
View File

@@ -0,0 +1,36 @@
package format
import (
"fmt"
"testing"
)
func TestParseYY(t *testing.T) {
_, tokens := Lexer(`yy-`)
ds := Parse(tokens)
fmt.Println(ds.Format(8100, true))
}
func TestParseMM(t *testing.T) {
_, tokens := Lexer(`yyyymm`)
ds := Parse(tokens)
fmt.Println(ds.Format(8100, true))
}
func TestParseMM2(t *testing.T) {
_, tokens := Lexer(`yyyy-mm"fasd65af"----`)
ds := Parse(tokens)
fmt.Println(ds.Format(8800, false))
}
func TestParseDD(t *testing.T) {
_, tokens := Lexer(`yyyy-mm-dd`)
ds := Parse(tokens)
fmt.Println(ds.Format(8100, true))
}
func TestParseNum(t *testing.T) {
_, tokens := Lexer(`"$"#,##0.00`)
ds := Parse(tokens)
fmt.Println(ds.Format(8800, false))
}