summaryrefslogtreecommitdiff
path: root/internal/findlinks
diff options
context:
space:
mode:
Diffstat (limited to 'internal/findlinks')
-rw-r--r--internal/findlinks/findlinks_test.go51
-rw-r--r--internal/findlinks/html/ex1.html6
-rw-r--r--internal/findlinks/html/ex2.html17
-rw-r--r--internal/findlinks/html/ex3.html62
-rw-r--r--internal/findlinks/html/ex4.html5
-rw-r--r--internal/findlinks/html/ex_spaces.html5
6 files changed, 0 insertions, 146 deletions
diff --git a/internal/findlinks/findlinks_test.go b/internal/findlinks/findlinks_test.go
deleted file mode 100644
index 79fb241..0000000
--- a/internal/findlinks/findlinks_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package findlinks
-
-import (
- "os"
- "testing"
-
- "github.com/google/go-cmp/cmp"
-)
-
-func findLinksFile(filename string) ([]Link, error) {
- f, err := os.Open(filename)
- if err != nil {
- panic("can't open test file")
- }
- defer f.Close()
-
- return FindLinks(f)
-}
-
-func TestFindlinks(t *testing.T) {
- type test struct {
- filename string
- links []Link
- }
-
- tests := []test{
- {
- "html/ex1.html",
- []Link{
- {
- Href: "/other-page",
- Text: "A link to another page",
- },
- },
- },
- }
-
- for _, test := range tests {
- t.Run(test.filename, func(t *testing.T) {
- links, err := findLinksFile(test.filename)
- if err != nil {
- t.Error(err)
- }
-
- if !cmp.Equal(links, test.links) {
- t.Errorf("got %v, want %v", links, test.links)
- }
- })
- }
-
-}
diff --git a/internal/findlinks/html/ex1.html b/internal/findlinks/html/ex1.html
deleted file mode 100644
index 833f110..0000000
--- a/internal/findlinks/html/ex1.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body>
- <h1>Hello!</h1>
- <a href="/other-page">A link to another page</a>
-</body>
-</html>
diff --git a/internal/findlinks/html/ex2.html b/internal/findlinks/html/ex2.html
deleted file mode 100644
index 3d22f94..0000000
--- a/internal/findlinks/html/ex2.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
-<head>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
-</head>
-<body>
- <h1>Social stuffs</h1>
- <div>
- <a href="https://www.twitter.com/joncalhoun">
- Check me out on twitter
- <i class="fa fa-twitter" aria-hidden="true"></i>
- </a>
- <a href="https://github.com/gophercises">
- Gophercises is on <strong>Github</strong>!
- </a>
- </div>
-</body>
-</html>
diff --git a/internal/findlinks/html/ex3.html b/internal/findlinks/html/ex3.html
deleted file mode 100644
index 1e718e2..0000000
--- a/internal/findlinks/html/ex3.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<!--[if lt IE 7]> <html class="ie ie6 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
-<!--[if IE 7]> <html class="ie ie7 lt-ie9 lt-ie8" lang="en"> <![endif]-->
-<!--[if IE 8]> <html class="ie ie8 lt-ie9" lang="en"> <![endif]-->
-<!--[if IE 9]> <html class="ie ie9" lang="en"> <![endif]-->
-<!--[if !IE]><!-->
-<html lang="en" class="no-ie">
-<!--<![endif]-->
-
-<head>
- <title>Gophercises - Coding exercises for budding gophers</title>
-</head>
-
-<body>
- <section class="header-section">
- <div class="jumbo-content">
- <div class="pull-right login-section">
- Already have an account?
- <a href="#" class="btn btn-login">Login <i class="fa fa-sign-in" aria-hidden="true"></i></a>
- </div>
- <center>
- <img src="https://gophercises.com/img/gophercises_logo.png" style="max-width: 85%; z-index: 3;">
- <h1>coding exercises for budding gophers</h1>
- <br/>
- <form action="/do-stuff" method="post">
- <div class="input-group">
- <input type="email" id="drip-email" name="fields[email]" class="btn-input" placeholder="Email Address" required>
- <button class="btn btn-success btn-lg" type="submit">Sign me up!</button>
- <a href="/lost">Lost? Need help?</a>
- </div>
- </form>
- <p class="disclaimer disclaimer-box">Gophercises is 100% FREE, but is currently in beta. There will be bugs, and things will be changing significantly over the coming weeks.</p>
- </center>
- </div>
- </section>
- <section class="footer-section">
- <div class="row">
- <div class="col-md-6 col-md-offset-1 vcenter">
- <div class="quote">
- "Success is no accident. It is hard work, perseverance, learning, studying, sacrifice and most of all, love of what you are doing or learning to do." - Pele
- </div>
- </div>
- <div class="col-md-4 col-md-offset-0 vcenter">
- <center>
- <img src="https://gophercises.com/img/gophercises_lifting.gif" style="width: 80%">
- <br/>
- <br/>
- </center>
- </div>
- </div>
- <div class="row">
- <div class="col-md-10 col-md-offset-1">
- <center>
- <p class="disclaimer">
- Artwork created by Marcus Olsson (<a href="https://twitter.com/marcusolsson">@marcusolsson</a>), animated by Jon Calhoun (that's me!), and inspired by the original Go Gopher created by Renee French.
- </p>
- </center>
- </div>
- </div>
- </section>
-</body>
-</html>
diff --git a/internal/findlinks/html/ex4.html b/internal/findlinks/html/ex4.html
deleted file mode 100644
index 0e893b8..0000000
--- a/internal/findlinks/html/ex4.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
- <a href="/dog-cat">dog cat <!-- commented text SHOULD NOT be included! --></a>
-</body>
-</html>
diff --git a/internal/findlinks/html/ex_spaces.html b/internal/findlinks/html/ex_spaces.html
deleted file mode 100644
index 943f405..0000000
--- a/internal/findlinks/html/ex_spaces.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
- <body>
- <a href="/spaces"> </a>
- </body>
-</html>