Commit graph

12 commits

Author SHA1 Message Date
bep 9f77f93071 Fix various Windows-issues
File handling was broken on Windows. This commit contains a revision of the path handling with separation of file paths and urls where needed.

There may be remaining issues and there may be better ways to do this, but it is easier to start that refactoring job with a set of passing tests.

Fixes #687
Fixes #660
2014-12-09 09:43:15 -05:00
bep 91e03b9fbc Reinsert deleted test
This test was deleted by mistake in owenwaller's contribution to add more tests.

I haven't looked closer, there may be more missing.
2014-11-13 22:47:06 -05:00
spf13 cafd39eb9b Fixing some tests 2014-11-04 20:28:27 -05:00
spf13 55fb02428d Updating tests to use hugofs 2014-11-04 20:28:07 -05:00
spf13 a40bd3caf1 rewriting guessSection to accurately reflect intent and usage. Update tests. 2014-11-04 20:19:45 -05:00
Owen Waller e2634752ce First stab at correcting GuessSection tests
Updated the test to correctly test for "" when a non-absolute path
is used.

But the tests still fail for multi-part paths e.g. /contents/blog/
2014-11-04 19:19:27 -05:00
Owen Waller 5906c8652d Fix: remove the unnecessary dot in an extension
Oops minor typo. The new extension passed to ReplaceExtension should
not have a dot in it. The test data bas been updated to reflect this.
2014-11-04 19:19:09 -05:00
Owen Waller 3521e8b1e5 Updated TestReplaceExtensioni, TestFilename and TestFileAndExt
Updated the test cases in TestReplaceExtension to reflect the intent
of ReplaceExtension which is to accept a path and return only the file
name with a new extension. It's intentionally designed to strip out the
path and only provide the filename

Additional test cases have been added to both TestFilename and
TestFileAndExt to clarify behaviour with relative paths.
2014-11-04 19:19:01 -05:00
Owen Waller 980d0f14de WriteToDisk and SafeWriteToDisk test cleaned up
Minor cleanup to randomise the names of the temp directories used by the
tests.
2014-11-04 19:18:54 -05:00
Owen Waller bf07dc9293 WriteToDisk and SafeWriteToDisk tests now pass
This is the first time that both the WriteToDisk and SafeWriteToDisk
tests pass
2014-11-04 19:18:46 -05:00
Owen Waller a54ad2bf39 Fix: Test TestSafeWriteToDisk now works
Oops, my bad.
Despite the function intending to test SafeWriteToDisk it was actually
calling WriteToDisk. WriteToDisk does not return the file exists error
that SafeWriteToDisk does, which the test checks for.
2014-11-04 19:18:36 -05:00
Owen Waller e8bbc44ab0 Added the path modules test files
Added the new path modules test file. This replaces the old
helpers_test.go file.

The currently failing tests are:
TestReplaceExtension
TestFilename
TestFileAndExt
TestGuessSection
TestFindCWD
TestWriteToDisk

In addition the TestSafeWriteToDisk test case is currently disabled.
It will panic if enabled.

In addition there are some minor changes to path.go. They are:
Refactored MakePathToLower to simplify it.
Commented out, pending removal, Sanitize as it appears to be unused.
Fixed the resource leak in UnicodeSanitize

Conflicts:
	helpers/path.go
2014-11-04 19:18:04 -05:00