示例#1
0
func TestSymbolsMerge(t *testing.T) {
	to := i18n.NewSymbols()
	from := i18n.Symbols{
		Decimal:                '',
		Group:                  '',
		List:                   '',
		PercentSign:            '',
		CurrencySign:           '',
		PlusSign:               '',
		MinusSign:              '',
		Exponential:            '',
		SuperscriptingExponent: '',
		PerMille:               '',
		Infinity:               '',
		Nan:                    []byte(`Pear`),
	}
	to.Merge(from)
	assert.EqualValues(t, from, to)
	to.Merge(i18n.Symbols{})
	assert.EqualValues(t, from, to)
}
示例#2
0
func TestSymbolsString(t *testing.T) {
	assert.Equal(t,
		"Decimal\t\t\t\t\t.\nGroup\t\t\t\t\t,\nList\t\t\t\t\t;\nPercentSign\t\t\t\t%\nCurrencySign\t\t\t¤\nPlusSign\t\t\t\t+\nMinusSign\t\t\t\t—\nExponential\t\t\t\tE\nSuperscriptingExponent\t×\nPerMille\t\t\t\t‰\nInfinity\t\t\t\t∞\nNaN\t\t\t\t\t\tNaN\n",
		i18n.NewSymbols().String())
}