<commit_before>package letsencrypt

import (
	"crypto/rand"
	"crypto/rsa"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/pem"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/http/httptest"
	"reflect"
	"testing"
)

var (
	testDomain = "example.org"
	testURL    = "http://localhost:4000/directory"
)

func TestNewClient(t *testing.T) {
	if _, err := NewClient(testURL); err != nil {
		t.Fatal(err)
	}
}

func TestRegister(t *testing.T) {
	cli, err := NewClient(testURL)
	if err != nil {
		t.Fatal(err)
	}
	priv, err := rsa.GenerateKey(rand.Reader, 2048)
	if err != nil {
		t.Fatal(err)
	}
	reg, err := cli.NewRegistration(priv)
	if err != nil {
		t.Fatal(err)
	}
	reg.Contact = []string{"mailto:<EMAIL>", "tel:+12025551212"}
	updatedReg, err := cli.UpdateRegistration(priv, reg)
	if err != nil {
		t.Fatal(err)
	}
	if len(updatedReg.Contact) != 2 {
		t.Errorf("expected update to add two contacts, got %s", updatedReg.Contact)
	}
	recoveredReg, err := cli.NewRegistration(priv)
	if err != nil {
		t.Errorf("expected recovered reg to have two contacts, got %s", recoveredReg.Contact)<commit_msg>remove test case which uses 'tel' contact<commit_after>package letsencrypt

import (
	"crypto/rand"
	"crypto/rsa"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/pem"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/http/httptest"
	"reflect"
	"testing"
)

var (
	testDomain = "example.org"
	testURL    = "http://localhost:4000/directory"
)

func TestNewClient(t *testing.T) {
	if _, err := NewClient(testURL); err != nil {
		t.Fatal(err)
	}
}

func TestRegister(t *testing.T) {
	cli, err := NewClient(testURL)
	if err != nil {
		t.Fatal(err)
	}
	priv, err := rsa.GenerateKey(rand.Reader, 2048)
	if err != nil {
		t.Fatal(err)
	}
	reg, err := cli.NewRegistration(priv)
	if err != nil {
		t.Fatal(err)
	}
	reg.Contact = []string{"mailto:<EMAIL>"}
	updatedReg, err := cli.UpdateRegistration(priv, reg)
	if err != nil {
		t.Fatal(err)
	}
	if len(updatedReg.Contact) != 1 {
		t.Errorf("expected update to add one contact, got %s", updatedReg.Contact)
	}
	recoveredReg, err := cli.NewRegistration(priv)
	if err != nil {
		t.Errorf("expected recovered reg to have two contacts, got %s", recoveredReg.Contact)
{'fraction_non_alphanumeric': 0.16522530723714154, 'fraction_numerical': 0.018661811561219845, 'mean_word_length': 3.9954545454545456, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3040810', 'n_tokens_mistral': 936, 'n_tokens_neox': 880, 'n_words': 192}