<commit_before>package simplehstore

import (
	"testing"
)

func TestPostgresPrefix(t *testing.T) {
	Verbose = true
	a := "postgres://user:pass@0.0.0.0:5432/postgres?sslmode=disable"
	s, dbname := rebuildConnectionString(a, true)
	if a != s {
		t.Errorf("Error, the connection string could not be picked apart correctly: %s != %s", a, s)
	}
	if dbname != "postgres" {
		t.Errorf("Error, the connection string could not be picked apart correctly. dbname != postgres, but: %s", dbname)
	}
}

func TestArgs(t *testing.T) {
	Verbose = true
	a := "postgres://user:pass@0.0.0.0:5432/postgres?user=myuser&password=<PASSWORD>&sslmode=enable"
	s, _ := rebuildConnectionString(a, true)
	if a != s {
		t.Errorf("Error, the connection string could not be picked apart correctly: %s != %s", a, s)
	}
}

func TestTravisDSN(t *testing.T) {
	Verbose = true
	a := "postgres:@127.0.0.1"
	b := "postgres://postgres@127.0.0.1:5432/test?sslmode=disable"
	s, _ := rebuildConnectionString(a, true)
	if s != b {
		t.Errorf("Error, the connection string could not be picked apart correctly:\n\t%s !=\n\t%s\ngiven %s", s, b, a)
	}
}

func TestTravisDSN2(t *testing.T) {
	Verbose = true
	a := "postgres:@127.0.0.1"
	b := "postgres://postgres@127.0.0.1:5432/?sslmode=disable"
	s, _ := rebuildConnectionString(a, false)
	if s != b {
		t.Errorf("Error, the connection string could not be picked apart correctly:\n\t%s !=\n\t%s\ngiven %s", s, b, a)
	}
}<commit_msg>Update test<commit_after>package simplehstore

import (
	"testing"

	"github.com/xyproto/env"
)

func TestPostgresPrefix(t *testing.T) {
	Verbose = true
	a := "postgres://user:pass@0.0.0.0:5432/postgres?sslmode=disable"
	s, dbname := rebuildConnectionString(a, true)
	if a != s {
		t.Errorf("Error, the connection string could not be picked apart correctly: %s != %s", a, s)
	}
	if dbname != "postgres" {
		t.Errorf("Error, the connection string could not be picked apart correctly. dbname != postgres, but: %s", dbname)
	}
}

func TestArgs(t *testing.T) {
	Verbose = true
	a := "postgres://user:pass@0.0.0.0:5432/postgres?user=myuser&password=<PASSWORD>&sslmode=enable"
	s, _ := rebuildConnectionString(a, true)
	if a != s {
		t.Errorf("Error, the connection string could not be picked apart correctly: %s != %s", a, s)
	}
}

func TestTravisDSN(t *testing.T) {
	Verbose = true
	a := "postgres:@127.0.0.1"
	b := "postgres://" + env.Str("POSTGRES_USER", "postgres") + ":" + env.Str("POSTGRES_PASSWORD") + "@127.0.0.1:5432/?sslmode=disable"
	s, _ := rebuildConnectionString(a, true)
	if s != b {
		t.Errorf("Error, the connection string could not be picked apart correctly:\n\t%s !=\n\t%s\ngiven %s", s, b, a)
	}
}

func TestTravisDSN2(t *testing.T) {
	Verbose = true
	a := "postgres:@127.0.0.1"
	b := "postgres://" + env.Str("POSTGRES_USER", "postgres") + ":" + env.Str("POSTGRES_PASSWORD") + "@127.0.0.1:5432/?sslmode=disable"
	s, _ := rebuildConnectionString(a, false)
	if s != b {
		t.Errorf("Error, the connection string could not be picked apart correctly:\n\t%s !=\n\t%s\ngiven %s", s, b, a)
	}
}
{'fraction_non_alphanumeric': 0.17825370675453048, 'fraction_numerical': 0.03228995057660626, 'mean_word_length': 4.3076923076923075, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '3047331', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1206, 'n_words': 284}