@@ -11,16 +11,31 @@ import (
1111 "github.com/stretchr/testify/assert"
1212)
1313
14- func TestGetTable (t * testing.T ) {
14+ func TestRespond (t * testing.T ) {
1515 file , _ := os .Open ("../testdata/results.txt" )
1616 defer file .Close () // nolint:errcheck
1717
18+ response := internal .Respond ("../testdata" )
19+
20+ // go line by line
21+ scanner := bufio .NewScanner (file )
22+ for scanner .Scan () {
23+ println (response , scanner .Text ())
24+ assert .True (t , strings .Contains (response , scanner .Text ()))
25+ }
26+ }
27+
28+ func TestGetTable (t * testing.T ) {
29+ file , _ := os .Open ("../testdata/languages.txt" )
30+ defer file .Close () // nolint:errcheck
31+
1832 statistics , _ := core .GetStatistics ("../testdata" )
19- table := internal .GetTable (statistics .Items , 5 , 3 , 5 )
33+ table := internal .GetTable (statistics .Languages , 5 , 3 , 5 )
2034
2135 // go line by line
2236 scanner := bufio .NewScanner (file )
2337 for scanner .Scan () {
38+ println (table , scanner .Text ())
2439 assert .True (t , strings .Contains (table , scanner .Text ()))
2540 }
2641}
0 commit comments