<commit_before>package network

import "testing"

func TestGenerateNetwork(t *testing.T) {
	test_cases := []struct {
		dd_address   string
		uint_address uint32
		dd_mask      string
		uint_mask    uint32
	}{
		{"192.168.1.0", 3232235776, "255.255.255.0", 4294967040},
	}

	for _, test_case := range test_cases {
		test_network, _ := GenerateNetwork(test_case.dd_address, test_case.dd_mask)

		if test_network.Address != test_case.uint_address {
			t.Errorf("generated address (%d) doesn't match spec address (%d)", test_network.Address, test_case.uint_address)
		}

		if test_network.Mask != test_case.uint_mask {
			t.Errorf("generated mask (%d) doesn't match spec mask (%d)", test_network.Mask, test_case.uint_mask)
		}<commit_msg>updated network test<commit_after>package network

import (
	"testing"

	"github.com/mpreath/netcalc/ipv4"
)

func TestGenerateNetwork(t *testing.T) {
	test_cases := []struct {
		dd_address         string
		dd_network_address string
		dd_mask            string
	}{
		{"192.168.1.1", "192.168.1.0", "255.255.255.0"},
	}

	for _, test_case := range test_cases {
		test_network, _ := GenerateNetwork(test_case.dd_address, test_case.dd_mask)

		dd_test_network, _ := ipv4.Itodd(test_network.Address)
		dd_test_mask, _ := ipv4.Itodd(test_network.Mask)

		if dd_test_network != test_case.dd_network_address {
			t.Errorf("generated address (%s) doesn't match spec address (%s)", dd_test_network, test_case.dd_network_address)
		}

		if dd_test_mask != test_case.dd_mask {
			t.Errorf("generated mask (%s) doesn't match spec mask (%s)", dd_test_mask, test_case.dd_mask)
		}
{'fraction_non_alphanumeric': 0.12625, 'fraction_numerical': 0.044375, 'mean_word_length': 4.354515050167224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 5, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6585076', 'n_tokens_mistral': 652, 'n_tokens_neox': 566, 'n_words': 112}