2024-07-01 07:16:55 +00:00
|
|
|
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
|
|
|
|
2024-09-19 08:03:23 +00:00
|
|
|
package fan
|
2024-07-01 07:16:55 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewPackageSource(t *testing.T) {
|
|
|
|
s := NewPackage()
|
|
|
|
assert.NotNil(t, s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestExtractPackages(t *testing.T) {
|
|
|
|
p := NewPackage()
|
|
|
|
assert.NotNil(t, p)
|
|
|
|
|
2024-09-19 08:03:23 +00:00
|
|
|
document, err := p.Extract(nil, nil)
|
2024-07-01 07:16:55 +00:00
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.NotNil(t, document)
|
2024-09-19 08:03:23 +00:00
|
|
|
assert.Greater(t, document.Len(), 0)
|
2024-07-01 07:16:55 +00:00
|
|
|
}
|