File: fields_test.go

package info (click to toggle)
termshark 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,800 kB
  • sloc: sh: 98; makefile: 9
file content (35 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
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
35
// Copyright 2019-2021 Graham Clark. All rights reserved.  Use of this source code is governed by the MIT license
// that can be found in the LICENSE file.

package termshark

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

//======================================================================

func TestFields1(t *testing.T) {

	fields := NewFields()
	err := fields.InitNoCache()
	assert.NoError(t, err)

	m1, ok := fields.fields.M["tcp"]
	assert.Equal(t, true, ok)

	m2, ok := m1.M["port"]
	assert.Equal(t, true, ok)

	_, ok = m2.M["foo"]
	assert.Equal(t, false, ok)

}

//======================================================================
// Local Variables:
// mode: Go
// fill-column: 78
// End: