gitee.com/quant1x/engine@v1.8.4/models/features_test.go (about) 1 package models 2 3 import ( 4 "fmt" 5 "gitee.com/quant1x/engine/cache" 6 "gitee.com/quant1x/engine/factors" 7 "gitee.com/quant1x/exchange" 8 "gitee.com/quant1x/gox/api" 9 "testing" 10 ) 11 12 func TestFeatureToSnapshot(t *testing.T) { 13 code := "600105" 14 securityCode := exchange.CorrectSecurityCode(code) 15 filename := cache.WideFilename(securityCode) 16 features := []factors.SecurityFeature{} 17 err := api.CsvToSlices(filename, &features) 18 if err != nil { 19 fmt.Println(err) 20 return 21 } 22 length := len(features) 23 feature := features[length-1] 24 v := FeatureToSnapshot(feature, securityCode) 25 fmt.Println(v) 26 }