mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
26 lines
435 B
Go
26 lines
435 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestMapSegmentWriterCanMap(t *testing.T) {
|
||
|
sc := &Segment{
|
||
|
Type: Session,
|
||
|
}
|
||
|
env := new(MockedEnvironment)
|
||
|
sc.mapSegmentWithWriter(env)
|
||
|
assert.NotNil(t, sc.writer)
|
||
|
}
|
||
|
|
||
|
func TestMapSegmentWriterCannotMap(t *testing.T) {
|
||
|
sc := &Segment{
|
||
|
Type: "nilwriter",
|
||
|
}
|
||
|
env := new(MockedEnvironment)
|
||
|
sc.mapSegmentWithWriter(env)
|
||
|
assert.Nil(t, sc.writer)
|
||
|
}
|