parent
3a941e4165
commit
a692abba9e
|
@ -0,0 +1,4 @@
|
|||
# filemanager
|
||||
|
||||
[![Build](https://img.shields.io/travis/hacdias/filemanager.svg?style=flat-square)](https://travis-ci.org/hacdias/filemanager)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/hacdias/filemanager?style=flat-square)](https://goreportcard.com/report/hacdias/filemanager)
|
|
@ -7,7 +7,6 @@ import (
|
|||
"github.com/hacdias/filemanager"
|
||||
)
|
||||
|
||||
|
||||
var m *filemanager.FileManager
|
||||
|
||||
func handler(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -21,4 +20,4 @@ func main() {
|
|||
m = filemanager.New()
|
||||
http.HandleFunc("/", handler)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,43 +8,43 @@ type hasRuneTest struct {
|
|||
}
|
||||
|
||||
var testHasRune = []hasRuneTest{
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`---
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Sed auctor libero eget ante fermentum commodo.
|
||||
---`),
|
||||
Return: true,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`+++
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Sed auctor libero eget ante fermentum commodo.
|
||||
+++`),
|
||||
Return: true,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`{
|
||||
"json": "Lorem ipsum dolor sit amet"
|
||||
}`),
|
||||
Return: true,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`+`),
|
||||
Return: false,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`++`),
|
||||
Return: false,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`-`),
|
||||
Return: false,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`--`),
|
||||
Return: false,
|
||||
},
|
||||
hasRuneTest{
|
||||
{
|
||||
File: []byte(`Lorem ipsum`),
|
||||
Return: false,
|
||||
},
|
||||
|
|
|
@ -8,14 +8,14 @@ type interfaceToBool struct {
|
|||
}
|
||||
|
||||
var testIsMap = []*interfaceToBool{
|
||||
&interfaceToBool{"teste", false},
|
||||
&interfaceToBool{453478, false},
|
||||
&interfaceToBool{-984512, false},
|
||||
&interfaceToBool{true, false},
|
||||
&interfaceToBool{map[string]bool{}, true},
|
||||
&interfaceToBool{map[int]bool{}, true},
|
||||
&interfaceToBool{map[interface{}]bool{}, true},
|
||||
&interfaceToBool{[]string{}, false},
|
||||
{"teste", false},
|
||||
{453478, false},
|
||||
{-984512, false},
|
||||
{true, false},
|
||||
{map[string]bool{}, true},
|
||||
{map[int]bool{}, true},
|
||||
{map[interface{}]bool{}, true},
|
||||
{[]string{}, false},
|
||||
}
|
||||
|
||||
func TestIsMap(t *testing.T) {
|
||||
|
@ -27,17 +27,17 @@ func TestIsMap(t *testing.T) {
|
|||
}
|
||||
|
||||
var testIsSlice = []*interfaceToBool{
|
||||
&interfaceToBool{"teste", false},
|
||||
&interfaceToBool{453478, false},
|
||||
&interfaceToBool{-984512, false},
|
||||
&interfaceToBool{true, false},
|
||||
&interfaceToBool{map[string]bool{}, false},
|
||||
&interfaceToBool{map[int]bool{}, false},
|
||||
&interfaceToBool{map[interface{}]bool{}, false},
|
||||
&interfaceToBool{[]string{}, true},
|
||||
&interfaceToBool{[]int{}, true},
|
||||
&interfaceToBool{[]bool{}, true},
|
||||
&interfaceToBool{[]interface{}{}, true},
|
||||
{"teste", false},
|
||||
{453478, false},
|
||||
{-984512, false},
|
||||
{true, false},
|
||||
{map[string]bool{}, false},
|
||||
{map[int]bool{}, false},
|
||||
{map[interface{}]bool{}, false},
|
||||
{[]string{}, true},
|
||||
{[]int{}, true},
|
||||
{[]bool{}, true},
|
||||
{[]interface{}{}, true},
|
||||
}
|
||||
|
||||
func TestIsSlice(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue