<commit_before>package vcs

import (
	"io/ioutil"
	"os"
	"os/exec"
	"runtime"
	"strings"
	"testing"
)

func TestVCSLookup(t *testing.T) {
	// TODO: Expand to make sure it detected the right vcs.
	urlList := map[string]struct {
		work bool
		t    Type
	}{
		"https://github.com/masterminds":                                   {work: false, t: Git},
		"https://github.com/Masterminds/VCSTestRepo":                       {work: true, t: Git},
		"https://bitbucket.org/mattfarina/testhgrepo":                      {work: true, t: Hg},
		"https://bitbucket.org/mattfarina/repo-does-not-exist":             {work: false, t: Hg},
		"https://bitbucket.org/mattfarina/private-repo-for-vcs-testing":    {work: false, t: Hg},
		"https://launchpad.net/govcstestbzrrepo/trunk":                     {work: true, t: Bzr},
		"https://launchpad.net/~mattfarina/+junk/mygovcstestbzrrepo":       {work: true, t: Bzr},
		"https://launchpad.net/~mattfarina/+junk/mygovcstestbzrrepo/trunk": {work: true, t: Bzr},
		"https://git.launchpad.net/govcstestgitrepo":                       {work: true, t: Git},
		"https://git.launchpad.net/~mattfarina/+git/mygovcstestgitrepo":    {work: true, t: Git},
		"https://hub.jazz.net/git/user1/pkgname":                           {work: true, t: Git},
		"https://hub.jazz.net/git/user1/pkgname/subpkg/subpkg/subpkg":      {work: true, t: Git},
		"https://hubs.jazz.net/git/user1/pkgname":                          {work: false, t: Git},
		"https://example.com/foo/bar.git":                                  {work: true, t: Git},
		"https://example.com/foo/bar.svn":                                  {work: true, t: Svn},
		"https://example.com/foo/bar/baz.bzr":                              {work: true, t: Bzr},
		"https://example.com/foo/bar/baz.hg":                               {work: true, t: Hg},
		"https://gopkg.in/tomb.v1":                                         {work: true, t: Git},
		"https://golang.org/x/net":                                         {work: true, t: Git},
		"https://speter.net/go/exp/math/dec/inf":                           {work: true, t: Git},
		"https://git.openstack.org/foo/bar":                                {work: true, t: Git},
		"<EMAIL>:Masterminds/vcs.git":                               {work: true, t: Git},
		"<EMAIL>:foo.git":                                          {work: true, t: Git},
		"ssh://hg@bitbucket.org/mattfarina/testhgrepo":                     {work: true, t: Hg},
		"<EMAIL>:mattfarina/glide-bitbucket-example.git":         {work: true, t: Git},<commit_msg>remove speter.net from VCS remote tests<commit_after>package vcs

import (
	"io/ioutil"
	"os"
	"os/exec"
	"runtime"
	"strings"
	"testing"
)

func TestVCSLookup(t *testing.T) {
	// TODO: Expand to make sure it detected the right vcs.
	urlList := map[string]struct {
		work bool
		t    Type
	}{
		"https://github.com/masterminds":                                   {work: false, t: Git},
		"https://github.com/Masterminds/VCSTestRepo":                       {work: true, t: Git},
		"https://bitbucket.org/mattfarina/testhgrepo":                      {work: true, t: Hg},
		"https://bitbucket.org/mattfarina/repo-does-not-exist":             {work: false, t: Hg},
		"https://bitbucket.org/mattfarina/private-repo-for-vcs-testing":    {work: false, t: Hg},
		"https://launchpad.net/govcstestbzrrepo/trunk":                     {work: true, t: Bzr},
		"https://launchpad.net/~mattfarina/+junk/mygovcstestbzrrepo":       {work: true, t: Bzr},
		"https://launchpad.net/~mattfarina/+junk/mygovcstestbzrrepo/trunk": {work: true, t: Bzr},
		"https://git.launchpad.net/govcstestgitrepo":                       {work: true, t: Git},
		"https://git.launchpad.net/~mattfarina/+git/mygovcstestgitrepo":    {work: true, t: Git},
		"https://hub.jazz.net/git/user1/pkgname":                           {work: true, t: Git},
		"https://hub.jazz.net/git/user1/pkgname/subpkg/subpkg/subpkg":      {work: true, t: Git},
		"https://hubs.jazz.net/git/user1/pkgname":                          {work: false, t: Git},
		"https://example.com/foo/bar.git":                                  {work: true, t: Git},
		"https://example.com/foo/bar.svn":                                  {work: true, t: Svn},
		"https://example.com/foo/bar/baz.bzr":                              {work: true, t: Bzr},
		"https://example.com/foo/bar/baz.hg":                               {work: true, t: Hg},
		"https://gopkg.in/tomb.v1":                                         {work: true, t: Git},
		"https://golang.org/x/net":                                         {work: true, t: Git},
		"https://git.openstack.org/foo/bar":                                {work: true, t: Git},
		"<EMAIL>:Masterminds/vcs.git":                               {work: true, t: Git},
		"<EMAIL>:foo.git":                                          {work: true, t: Git},
		"ssh://hg@bitbucket.org/mattfarina/testhgrepo":                     {work: true, t: Hg},
		"<EMAIL>:mattfarina/glide-bitbucket-example.git":         {work: true, t: Git},
{'fraction_non_alphanumeric': 0.17411248504188273, 'fraction_numerical': 0.0015955325089748703, 'mean_word_length': 1.7166847237269773, 'pattern_counts': {'":': 49, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 41, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7026945', 'n_tokens_mistral': 1844, 'n_tokens_neox': 1698, 'n_words': 305}