~dricottone/image2ascii

ref: dff12c38d66913f60ad6f66a8a6ac7f731c141bc image2ascii/image2ascii_test.go -rw-r--r-- 707 bytes
dff12c38Dominic Ricottone Adding toolchain and updating documentation 2 years ago
                                                                                
e6d60b68 qeesung
6bbfcf8c qeesung
e6d60b68 qeesung
9e6742da qeesung
6bbfcf8c qeesung
e6d60b68 qeesung
9e6742da qeesung
e6d60b68 qeesung
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func TestParseEmptyFilenameOptions(t *testing.T) {
	assertions := assert.New(t)
	imageFilename = ""
	_, err := parseOptions()
	assertions.True(err != nil)
}

func TestParseOptions(t *testing.T) {
	assertions := assert.New(t)
	imageFilename = "filename"
	ratio = 0.5
	fitScreen = false
	colored = false
	fixedHeight = 100
	fixedWidth = 100
	opt, err := parseOptions()
	assertions.True(err == nil)
	assertions.Equal(ratio, opt.Ratio)
	assertions.False(fitScreen)
	assertions.False(colored)
	assertions.Equal(fixedWidth, opt.FixedWidth)
	assertions.Equal(fixedHeight, opt.FixedHeight)
}

func TestParseUsage(t *testing.T) {
	usage()
}