Browse Source

Fix broken test

pull/459/head
James Mills 4 days ago
parent
commit
9c5baf2f0a
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 2
      types/lextwt/ast.go
  2. 3
      types/lextwt/lextwt_test.go

2
types/lextwt/ast.go

@ -898,6 +898,8 @@ func (twt *Twt) ExpandMentions(opts types.FmtOpts, lookup types.FeedLookup) {
if sp := strings.SplitN(twter.Nick, "@", 2); len(sp) == 2 {
m.name = sp[0]
m.domain = sp[1]
} else {
m.name = twter.Nick
}
m.target = twter.URL
}

3
types/lextwt/lextwt_test.go

@ -1018,8 +1018,7 @@ func TestExpandLinks(t *testing.T) {
is := is.New(t)
for i, tt := range tests {
t.Logf("TestExpandLinks %d - %s", i, tt.target)
for _, tt := range tests {
lookup := types.FeedLookupFn(func(s string) *types.Twter { return tt.target })
tt.twt.ExpandMentions(conf, lookup)
is.Equal(tt.twt.Mentions()[0].Twter().Nick, tt.target.Nick)

Loading…
Cancel
Save