-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable custom xlsx import with non-ibkr data
- Loading branch information
1 parent
4b9d4ba
commit 23bd49e
Showing
10 changed files
with
545 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestAssetBySymbols(t *testing.T) { | ||
a1 := &AssetImport{} | ||
a1.Symbols = []string{"A"} | ||
a2 := &AssetImport{} | ||
a2.Symbols = []string{"B", "C"} | ||
a3 := &AssetImport{} | ||
a3.Symbols = []string{"A", "B", "D"} | ||
|
||
assets := assets{} | ||
assets.bySymbols(a1.Symbols...) | ||
assets.bySymbols(a2.Symbols...) | ||
assets.bySymbols(a3.Symbols...) | ||
|
||
assetPtrs := make(map[*AssetImport]bool) | ||
for _, a := range assets { | ||
assetPtrs[a] = true | ||
} | ||
if len(assetPtrs) != 1 { | ||
t.Errorf("Expected 1 unique asset. Got %d", len(assetPtrs)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.