Skip to content

Commit

Permalink
Quote: Add first test (ref #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Vazard committed Nov 23, 2015
1 parent 4892810 commit 92eeaa3
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 60 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.exe
/goxxx
/storage/*
*.sqlite
*.txt
goxxx_testing.ini
*.exe
/goxxx
/storage/*
*.sqlite
*.txt
goxxx_testing.ini
32 changes: 16 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: go

go:
- 1.4.3
- 1.5.1

install:
- go get -t ./...

script:
- go test -v ./...

#branches:
# only:
# - master

language: go

go:
- 1.4.3
- 1.5.1

install:
- go get -t ./...

script:
- go test -v ./...

#branches:
# only:
# - master

21 changes: 21 additions & 0 deletions quote/quote_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// The MIT License (MIT)
//
// Copyright (c) 2015 Arnaud Vazard
//
// See LICENSE file.
package quote

import (
"testing"
)

func Test_prepareForSearch(t *testing.T) {

str := `This IS a; string.with, punctuation, quotes', and upper: "case" `
expectedResult := "this is a string with punctuation quotes and upper case"
result := prepareForSearch(str)
if result != expectedResult {
t.Errorf("Test result differ from expected result: \n Test result:\t%#v\nExpected result: %#v\n\n", result, expectedResult)
}

}
32 changes: 16 additions & 16 deletions webinfo/tests_data/page_with_multiline_title.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!-- Source: https://developer.mozilla.org/en-US/Learn/HTML/Write_a_simple_page_in_HTML -->
<!DOCTYPE html>
<html>
<head>
<title>The
Ultimate

Unicorn

</title>
</head>
<body>
This is a page with a title and a unicorn
<img src="unicorn_pic.png" alt="Unicorn picture :)" />
</body>
</html>
<!-- Source: https://developer.mozilla.org/en-US/Learn/HTML/Write_a_simple_page_in_HTML -->
<!DOCTYPE html>
<html>
<head>
<title>The
Ultimate

Unicorn

</title>
</head>
<body>
This is a page with a title and a unicorn
<img src="unicorn_pic.png" alt="Unicorn picture :)" />
</body>
</html>
22 changes: 11 additions & 11 deletions webinfo/tests_data/page_with_title.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Source: https://developer.mozilla.org/en-US/Learn/HTML/Write_a_simple_page_in_HTML -->
<!DOCTYPE html>
<html>
<head>
<title>The Ultimate Unicorn</title>
</head>
<body>
This is a page with a title and a unicorn
<img src="unicorn_pic.png" alt="Unicorn picture :)" />
</body>
</html>
<!-- Source: https://developer.mozilla.org/en-US/Learn/HTML/Write_a_simple_page_in_HTML -->
<!DOCTYPE html>
<html>
<head>
<title>The Ultimate Unicorn</title>
</head>
<body>
This is a page with a title and a unicorn
<img src="unicorn_pic.png" alt="Unicorn picture :)" />
</body>
</html>
22 changes: 11 additions & 11 deletions webinfo/tests_data/page_with_title_containing_spaces.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Source: https://developer.mozilla.org/en-US/Learn/HTML/Write_a_simple_page_in_HTML -->
<!DOCTYPE html>
<html>
<head>
<title> The Ultimate Unicorn </title>
</head>
<body>
This is a page with a title and a unicorn
<img src="unicorn_pic.png" alt="Unicorn picture :)" />
</body>
</html>
<!-- Source: https://developer.mozilla.org/en-US/Learn/HTML/Write_a_simple_page_in_HTML -->
<!DOCTYPE html>
<html>
<head>
<title> The Ultimate Unicorn </title>
</head>
<body>
This is a page with a title and a unicorn
<img src="unicorn_pic.png" alt="Unicorn picture :)" />
</body>
</html>

0 comments on commit 92eeaa3

Please sign in to comment.