Skip to content

Commit

Permalink
Fix test and check errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaq committed Jan 19, 2025
1 parent f186ddf commit 5ca6ebc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[codespell]
ignore-words-list = ro,upto,nd,doas,fo,shouldbe,iterm,lates,testof
ignore-words-list = ro,upto,nd,doas,fo,shouldbe,iterm,lates,testof,golab
skip = ./.git,./vscode/node_modules,./vscode/dist,./website/_dst,./website/*.html
2 changes: 2 additions & 0 deletions pkg/etkedit/addon_histlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type histlistItems struct {
last map[string]int
}

/*
func (it histlistItems) filter(p func(string) bool, dedup bool) histlistItems {
var filtered []storedefs.Cmd
for i, entry := range it.entries {
Expand All @@ -56,6 +57,7 @@ func (it histlistItems) filter(p func(string) bool, dedup bool) histlistItems {
}
return histlistItems{filtered, nil}
}
*/

func (it histlistItems) Len() int { return len(it.entries) }
func (it histlistItems) Get(i int) any { return it.entries[i] }
Expand Down
2 changes: 2 additions & 0 deletions pkg/etkedit/addon_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type locationItems struct {
dirs []storedefs.Dir
}

/*
func (l locationItems) filter(p func(string) bool) locationItems {
var filteredDirs []storedefs.Dir
for _, dir := range l.dirs {
Expand All @@ -39,6 +40,7 @@ func (l locationItems) filter(p func(string) bool) locationItems {
}
return locationItems{filteredDirs}
}
*/

func (l locationItems) Len() int { return len(l.dirs) }
func (l locationItems) Get(i int) any { return l.dirs[i] }
Expand Down
4 changes: 3 additions & 1 deletion pkg/etkedit/transcripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
edit "src.elv.sh/pkg/etkedit"
"src.elv.sh/pkg/eval"
"src.elv.sh/pkg/eval/evaltest"
"src.elv.sh/pkg/store"
"src.elv.sh/pkg/testutil"
"src.elv.sh/pkg/ui"
)
Expand All @@ -17,6 +18,7 @@ import (
var transcripts embed.FS

func TestTranscripts(t *testing.T) {
st := store.MustTempStore(t)
evaltest.TestTranscriptsInFS(t, transcripts,
"edit-fixture", func(t *testing.T, ev *eval.Evaler) {
// The default prompt and rprompt depends on environment factors
Expand All @@ -32,7 +34,7 @@ func TestTranscripts(t *testing.T) {
testutil.Set(t, edit.HasCommandPtr, hasBuiltinCmd)
testutil.Set(t, edit.HasCommandMaxBlockPtr, func() time.Duration { return time.Hour })

ed := edit.NewEditor(ev)
ed := edit.NewEditor(ev, st)
ev.ExtendBuiltin(eval.BuildNs().AddNs("edit", ed))
etktest.Setup(t, ev, ed.Comp())
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/eval/builtin_fn_styled_test.elvts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Exception: cannot concatenate fn and ui:text-segment

## text + unsupported ##
~> to-string (styled abc){ }
Exception: cannot concatenate ui:text and fn
Exception: cannot concatenate styled and fn
[tty]:1:11-25: to-string (styled abc){ }

## string + text ##
Expand All @@ -183,7 +183,7 @@ Exception: cannot concatenate ui:text and fn

## unsupported + text ##
~> to-string { }(styled abc)
Exception: cannot concatenate fn and ui:text
Exception: cannot concatenate fn and styled
[tty]:1:11-25: to-string { }(styled abc)

## introspecting concatenated text ##
Expand Down
8 changes: 0 additions & 8 deletions pkg/mods/etk/etk.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import (
"src.elv.sh/pkg/ui"
)

type textViewOpts struct{ DotBefore int }

func (*textViewOpts) SetDefaultOptions() {}

var Ns = eval.BuildNsNamed("etk").
AddVars(map[string]vars.Var{
// etk.Reaction values
Expand Down Expand Up @@ -90,10 +86,6 @@ type viewReact struct {
React etk.React
}

type vboxOpts struct{ Focus int }

func (*vboxOpts) SetDefaultOptions() {}

func scanCompFromFn(fm *eval.Frame, fn eval.Callable) etk.Comp {
return func(c etk.Context) (etk.View, etk.React) {
subcomps := map[string]viewReact{}
Expand Down

0 comments on commit 5ca6ebc

Please sign in to comment.