<commit_before>package norway

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestParseEntryNoSubDirectories(t *testing.T) {
	Convey("Given a single directory line that indicates no sub-directories", t, func() {
		entryLine := "D"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be true", func() {
				So(entry.IsDirectory, ShouldBeTrue)
			})
		})
	})
}

func TestParseEntryFile(t *testing.T) {
	Convey("Given a regular file entry", t, func() {
		entryLine := "/bio_ssl.c/1.14/Mon Apr 21 16:34:43 2014//"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be false", func() {
				So(entry.IsDirectory, ShouldBeFalse)
			})
			Convey("IsRemoved should be false", func() {
				So(entry.IsRemoved, ShouldBeFalse)
			})
			Convey("IsAdded should be false", func() {
				So(entry.IsAdded, ShouldBeFalse)
			})
			Convey("FileName should match bio_ssl.c", func() {
				So(entry.FileName, ShouldEqual, "bio_ssl.c")
			})
			Convey("Revision should match 1.14", func() {
				So(entry.Revision, ShouldEqual, "1.14")
			})
			Convey("Timestamp should match Mon Apr 21 16:34:43 2014", func() {
				So(entry.Timestamp, ShouldEqual, "Mon Apr 21 16:34:43 2014")
			})
			Convey("Options should be an empty string", func() {
				So(entry.Options, ShouldEqual, "")
			})
			Convey("Tagdate should be an empty string", func() {
				So(entry.Tagdate, ShouldEqual, "")
			})
		})
	})
}

func TestParseEntryFileWithOptions(t *testing.T) {
	Convey("Given a regular file entry with options", t, func() {
		entryLine := "/some_file.c/10.24/Fri Apr 11 08:17:05 2014/-kkv/"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be false", func() {
				So(entry.IsDirectory, ShouldBeFalse)
			})
			Convey("IsRemoved should be false", func() {
				So(entry.IsRemoved, ShouldBeFalse)
			})
			Convey("IsAdded should be false", func() {
				So(entry.IsAdded, ShouldBeFalse)
			})
			Convey("FileName should match some_file.c", func() {
				So(entry.FileName, ShouldEqual, "some_file.c")
			})
			Convey("Revision should match 1.24", func() {
				So(entry.Revision, ShouldEqual, "1.24")
			})
			Convey("Timestamp should match Fri Apr 11 08:17:05 2014", func() {
				So(entry.Timestamp, ShouldEqual, "Fri Apr 11 08:17:05 2014")
			})
			Convey("Options should be equal to -kkv", func() {
				So(entry.Options, ShouldEqual, "-kkv")
			})
			Convey("Tagdate should be an empty string", func() {
				So(entry.Tagdate, ShouldEqual, "")
			})
		})
	})
}

func TestParseEntryFileWithTag(t *testing.T) {
	Convey("Given a regular file entry with options", t, func() {
		entryLine := "/some_file.bin/10.1.4.1.22.1/Tue Apr  8 14:00:44 2014/-kb/TB_01_05X_000Y_snapshots"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be false", func() {
				So(entry.IsDirectory, ShouldBeFalse)
			})
			Convey("IsRemoved should be false", func() {
				So(entry.IsRemoved, ShouldBeFalse)
			})
			Convey("IsAdded should be false", func() {<commit_msg>Fix the parsing test expected revision<commit_after>package norway

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestParseEntryNoSubDirectories(t *testing.T) {
	Convey("Given a single directory line that indicates no sub-directories", t, func() {
		entryLine := "D"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be true", func() {
				So(entry.IsDirectory, ShouldBeTrue)
			})
		})
	})
}

func TestParseEntryFile(t *testing.T) {
	Convey("Given a regular file entry", t, func() {
		entryLine := "/bio_ssl.c/1.14/Mon Apr 21 16:34:43 2014//"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be false", func() {
				So(entry.IsDirectory, ShouldBeFalse)
			})
			Convey("IsRemoved should be false", func() {
				So(entry.IsRemoved, ShouldBeFalse)
			})
			Convey("IsAdded should be false", func() {
				So(entry.IsAdded, ShouldBeFalse)
			})
			Convey("FileName should match bio_ssl.c", func() {
				So(entry.FileName, ShouldEqual, "bio_ssl.c")
			})
			Convey("Revision should match 1.14", func() {
				So(entry.Revision, ShouldEqual, "1.14")
			})
			Convey("Timestamp should match Mon Apr 21 16:34:43 2014", func() {
				So(entry.Timestamp, ShouldEqual, "Mon Apr 21 16:34:43 2014")
			})
			Convey("Options should be an empty string", func() {
				So(entry.Options, ShouldEqual, "")
			})
			Convey("Tagdate should be an empty string", func() {
				So(entry.Tagdate, ShouldEqual, "")
			})
		})
	})
}

func TestParseEntryFileWithOptions(t *testing.T) {
	Convey("Given a regular file entry with options", t, func() {
		entryLine := "/some_file.c/10.24/Fri Apr 11 08:17:05 2014/-kkv/"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be false", func() {
				So(entry.IsDirectory, ShouldBeFalse)
			})
			Convey("IsRemoved should be false", func() {
				So(entry.IsRemoved, ShouldBeFalse)
			})
			Convey("IsAdded should be false", func() {
				So(entry.IsAdded, ShouldBeFalse)
			})
			Convey("FileName should match some_file.c", func() {
				So(entry.FileName, ShouldEqual, "some_file.c")
			})
			Convey("Revision should match 10.24", func() {
				So(entry.Revision, ShouldEqual, "10.24")
			})
			Convey("Timestamp should match Fri Apr 11 08:17:05 2014", func() {
				So(entry.Timestamp, ShouldEqual, "Fri Apr 11 08:17:05 2014")
			})
			Convey("Options should be equal to -kkv", func() {
				So(entry.Options, ShouldEqual, "-kkv")
			})
			Convey("Tagdate should be an empty string", func() {
				So(entry.Tagdate, ShouldEqual, "")
			})
		})
	})
}

func TestParseEntryFileWithTag(t *testing.T) {
	Convey("Given a regular file entry with options", t, func() {
		entryLine := "/some_file.bin/10.1.4.1.22.1/Tue Apr  8 14:00:44 2014/-kb/TB_01_05X_000Y_snapshots"
		Convey("When the entry is parsed", func() {
			entry := ParseEntry(entryLine)
			Convey("IsDirectory should be false", func() {
				So(entry.IsDirectory, ShouldBeFalse)
			})
			Convey("IsRemoved should be false", func() {
				So(entry.IsRemoved, ShouldBeFalse)
			})
			Convey("IsAdded should be false", func() {
{'fraction_non_alphanumeric': 0.15011801730920535, 'fraction_numerical': 0.03713611329661684, 'mean_word_length': 3.8224582701062215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3334223', 'n_tokens_mistral': 2661, 'n_tokens_neox': 2151, 'n_words': 553}