impl NewBPIs(path)[currency].Get(date)

This commit is contained in:
Bel LaPointe
2023-10-25 13:44:46 -06:00
parent 4a4bcf3302
commit f2ec1233d7
2 changed files with 33 additions and 13 deletions

View File

@@ -157,5 +157,17 @@ P 2023-10-22 07:33:56 GME $17.18
t.Fatal(err)
}
if got := got["USDC"].Lookup("2099-01-01"); got != 0 {
t.Error("default got != 0:", got)
}
if got := got["GME"].Lookup("2099-01-01"); got != 17.18 {
t.Errorf("shouldve returned latest but got %v", got)
}
if got := got["GME"].Lookup("2023-09-19"); got != 18.22 {
t.Errorf("shouldve returned one day before but got %v", got)
}
if got := got["GME"].Lookup("2023-09-18"); got != 18.22 {
t.Errorf("shouldve returned day of but got %v", got)
}
t.Log(got)
}