-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
87 changed files
with
2,001 additions
and
25,168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ keywords: | |
- Github | ||
- text markup | ||
- screen play | ||
date-released: 2022-08-08 | ||
date-released: 2022-08-09 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,61 @@ | ||
package scripttool | ||
|
||
import "testing" | ||
import ( | ||
"io/fs" | ||
"os" | ||
"path" | ||
"strings" | ||
"testing" | ||
) | ||
|
||
var ( | ||
testdataBase = "testdata" | ||
testoutBase = "testout" | ||
) | ||
|
||
func TestRunScripttool(t *testing.T) { | ||
t.Fatal("not implemented") | ||
var verb string | ||
appName := os.Args[0] | ||
// Run the JSON command | ||
if _, err := os.Stat(testoutBase); err == nil { | ||
os.RemoveAll(testoutBase) | ||
} | ||
os.MkdirAll(testoutBase, 0775) | ||
fSys := os.DirFS(testdataBase) | ||
fs.WalkDir(fSys, ".", func(p string, info fs.DirEntry, err error) error { | ||
if !info.IsDir() { | ||
inName := info.Name() | ||
inExt := path.Ext(inName) | ||
outName := strings.TrimSuffix(inName, inExt) + ".json" | ||
|
||
//fmt.Printf("DEBUG pth: %q fName: %q, ext: %q\n", p, inName, inExt) | ||
switch inExt { | ||
case ".txt": | ||
verb = "fountain2json" | ||
case ".fountain": | ||
verb = "fountain2json" | ||
case ".fdx": | ||
verb = "fdx2json" | ||
case ".fadein": | ||
verb = "fadein2json" | ||
case ".osf": | ||
verb = "osf2json" | ||
default: | ||
// We're only doing | ||
//fmt.Printf("Skipping %q, unsupported to file extension %q\n", inName, inExt) | ||
return nil | ||
} | ||
// We'll just rely on our standard VERB INPUT_NAME OUTPUT_NAME | ||
in := os.Stdin | ||
out := os.Stdout | ||
eout := os.Stderr | ||
inputFName := path.Join(testdataBase, inName) | ||
outputFName := path.Join(testoutBase, outName) | ||
args := []string{appName, verb, inputFName, outputFName} | ||
if err := RunScripttool(in, out, eout, args); err != nil { | ||
t.Errorf("unexpected error RunScripttool(in, out, eout, %+v) -> %s", args, err) | ||
} | ||
} | ||
return nil | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.