Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[#1912] Improved test comments
  • Loading branch information
msiodelski committed Sep 2, 2025
commit c19d58fea104e1827c159a3695b02cf652bfc6c0
4 changes: 2 additions & 2 deletions backend/appcfg/bind9/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
)

// Test checking if the configuration contains a no-parse directives.
// Test checking if the configuration contains no-parse directives.
func TestConfigHasNoParse(t *testing.T) {
cfg := &Config{
Statements: []*Statement{
Expand All @@ -20,7 +20,7 @@ func TestConfigHasNoParse(t *testing.T) {
require.True(t, cfg.HasNoParse())
}

// Test checking if the configuration does not contain a no-parse directives.
// Test checking if the configuration does not contain no-parse directives.
func TestConfigHasNoParseNone(t *testing.T) {
cfg := &Config{}
require.False(t, cfg.HasNoParse())
Expand Down
5 changes: 5 additions & 0 deletions backend/appcfg/bind9/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ func TestParseOptionWithSuboptions(t *testing.T) {
require.Equal(t, "100", cfg.Statements[0].Options.Clauses[0].Option.Suboptions[1].Switches[0])
}

// Test parsing ACL with negated key.
func TestParseACLWithNegatedKey(t *testing.T) {
cfgText := `
acl "trusted-networks" {
Expand All @@ -751,6 +752,7 @@ func TestParseACLWithNegatedKey(t *testing.T) {
require.Equal(t, "guest-key", cfg.Statements[0].ACL.AddressMatchList.Elements[0].KeyID)
}

// Test parsing ACL with a key.
func TestParseACLWithKey(t *testing.T) {
cfgText := `
acl "guest-networks" {
Expand All @@ -769,6 +771,7 @@ func TestParseACLWithKey(t *testing.T) {
require.Equal(t, "guest-key", cfg.Statements[0].ACL.AddressMatchList.Elements[0].KeyID)
}

// Test parsing ACL with an unquoted ACL name.
func TestParseACLWithUnquotedACLName(t *testing.T) {
cfgText := `
acl "trusted-networks" {
Expand All @@ -786,6 +789,7 @@ func TestParseACLWithUnquotedACLName(t *testing.T) {
require.Equal(t, "localnets", cfg.Statements[0].ACL.AddressMatchList.Elements[0].IPAddressOrACLName)
}

// Test parsing ACL with a quoted ACL name.
func TestParseACLWithQuotedACLName(t *testing.T) {
cfgText := `
acl "trusted-networks" {
Expand All @@ -803,6 +807,7 @@ func TestParseACLWithQuotedACLName(t *testing.T) {
require.Equal(t, "localhosts", cfg.Statements[0].ACL.AddressMatchList.Elements[0].IPAddressOrACLName)
}

// Test parsing ACL with a quoted IPv4 address.
func TestParseACLWithQuotedIPv4Address(t *testing.T) {
cfgText := `
acl "trusted-networks" {
Expand Down