mirror of
https://github.com/nikolaydubina/calendarheatmap.git
synced 2025-02-08 03:41:02 +02:00
+example
This commit is contained in:
parent
0a6fbbf43e
commit
69afd7e253
@ -1,10 +1,28 @@
|
||||
package parsers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func ExampleBasicJSONParser() {
|
||||
parser := BasicJSONParser{}
|
||||
year, countByDay, err := parser.Parse([]byte(`
|
||||
"2020-01-02": 7,
|
||||
"2020-02-05": 2,
|
||||
"2020-02-04": 3
|
||||
}`))
|
||||
fmt.Print(year)
|
||||
fmt.Print(countByDay)
|
||||
fmt.Print(err)
|
||||
// expectedCountByDay := map[int]int{
|
||||
// 2: 7,
|
||||
// 36: 2,
|
||||
// 35: 3,
|
||||
// }
|
||||
}
|
||||
|
||||
func Test_BasicJSONParser_Basic(t *testing.T) {
|
||||
|
||||
t.Run("empty map", func(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user