mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
A very basic start to adding some unit tests
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package wtf
|
||||
|
||||
import(
|
||||
"time"
|
||||
)
|
||||
|
||||
type ConfigWatcher struct {
|
||||
UpdatedAt *time.Time
|
||||
}
|
||||
|
||||
func (watcher *ConfigWatcher) Watch() {
|
||||
|
||||
}
|
||||
@@ -9,6 +9,17 @@ type Position struct {
|
||||
height int
|
||||
}
|
||||
|
||||
func NewPosition(top, left, width, height int) Position {
|
||||
pos := Position{
|
||||
top: 0,
|
||||
left: 1,
|
||||
width: 2,
|
||||
height: 3,
|
||||
}
|
||||
|
||||
return pos
|
||||
}
|
||||
|
||||
func (pos *Position) Top() int {
|
||||
return pos.top
|
||||
}
|
||||
|
||||
@@ -29,14 +29,15 @@ func NewTextWidget(name string, configKey string, focusable bool) TextWidget {
|
||||
|
||||
Name: name,
|
||||
RefreshInt: Config.UInt(fmt.Sprintf("wtf.mods.%s.refreshInterval", configKey)),
|
||||
Position: Position{
|
||||
top: Config.UInt(fmt.Sprintf("wtf.mods.%s.position.top", configKey)),
|
||||
left: Config.UInt(fmt.Sprintf("wtf.mods.%s.position.left", configKey)),
|
||||
height: Config.UInt(fmt.Sprintf("wtf.mods.%s.position.height", configKey)),
|
||||
width: Config.UInt(fmt.Sprintf("wtf.mods.%s.position.width", configKey)),
|
||||
},
|
||||
}
|
||||
|
||||
widget.Position = NewPosition(
|
||||
Config.UInt(fmt.Sprintf("wtf.mods.%s.position.top", configKey)),
|
||||
Config.UInt(fmt.Sprintf("wtf.mods.%s.position.left", configKey)),
|
||||
Config.UInt(fmt.Sprintf("wtf.mods.%s.position.height", configKey)),
|
||||
Config.UInt(fmt.Sprintf("wtf.mods.%s.position.width", configKey)),
|
||||
)
|
||||
|
||||
widget.addView()
|
||||
|
||||
return widget
|
||||
|
||||
Reference in New Issue
Block a user