mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-27 20:09:39 -08:00
29 lines
530 B
Go
Executable file
29 lines
530 B
Go
Executable file
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestMapSegmentWriterCanMap(t *testing.T) {
|
|
sc := &Segment{
|
|
Type: Session,
|
|
}
|
|
env := new(MockedEnvironment)
|
|
props, err := sc.mapSegmentWithWriter(env)
|
|
assert.NotNil(t, props)
|
|
assert.NoError(t, err)
|
|
assert.NotNil(t, sc.writer)
|
|
}
|
|
|
|
func TestMapSegmentWriterCannotMap(t *testing.T) {
|
|
sc := &Segment{
|
|
Type: "nilwriter",
|
|
}
|
|
env := new(MockedEnvironment)
|
|
props, err := sc.mapSegmentWithWriter(env)
|
|
assert.Nil(t, props)
|
|
assert.Error(t, err)
|
|
}
|