Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrCompile = errors.New("compilation error") ErrExecute = errors.New("execution error") )
var Engines = map[string]Engine{ ".c": { Mode: "compile", Command: []string{"cc", "{file}", "-o", "{temp}", "-std=c17"}, }, ".cpp": { Mode: "compile", Command: []string{"c++", "{file}", "-o", "{temp}", "-std=c++17"}, }, ".go": { Mode: "compile", Command: []string{"go", "build", "-o", "{temp}", "{file}"}, }, ".py": { Mode: "interpret", Command: []string{"python3", "{file}"}, }, ".rs": { Mode: "compile", Command: []string{"rustc", "{file}", "-o", "{temp}"}, }, ".zig": { Mode: "compile", Command: []string{"zig", "build-exe", "{file}", "-femit-bin={temp}"}, }, }
default engines
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type NavigateMsg ¶
type NavigateMsg struct {
}
NavigateMsg is sent to navigate to a new path. If Path is empty, the app reverts to the active model derived from the current state, simulating popup dismissal. If Path is non-empty, the app state updates and the active model is derived from the new path (dir → filepicker, file → workspace).
type TestCase ¶
type TestCase struct {
Status TestCaseStatus `json:"status"`
Details string `json:"details"`
// Input is the data fed to the program's stdin.
Input string `json:"input"`
// Expected is the stdout the program should produce.
Expected string `json:"expected"`
// Output is the actual stdout (and stderr) captured during the last run.
Output string `json:"output"`
}
func NewTestCase ¶
func NewTestCase() *TestCase
NewTestCase returns a TestCase in its initial idle state.
type TestCaseExecutedMsg ¶
type TestCaseExecutedMsg struct {
TestCase *TestCase
}
TestCaseExecutedMsg is dispatched when a TestCase has finished running.
type TestCaseList ¶
type TestCaseList []*TestCase
TestCaseList is an ordered collection of test cases for a single source file.
func LoadTestCaseList ¶
func LoadTestCaseList(filePath string) TestCaseList
func (*TestCaseList) Append ¶
func (list *TestCaseList) Append()
Append adds a fresh, idle test case to the end of the list.
func (*TestCaseList) RemoveAt ¶
func (list *TestCaseList) RemoveAt(index int)
RemoveAt removes the test case at index. It is a no-op if index is out of range.
func (TestCaseList) Save ¶
func (list TestCaseList) Save(sourceFile string) error
type TestCaseStatus ¶
type TestCaseStatus string
TestCaseStatus is the verdict of the most recent run of a TestCase.
const ( TestCaseStatusPending TestCaseStatus = "Pending" TestCaseStatusCorrect TestCaseStatus = "Correct" TestCaseStatusWrong TestCaseStatus = "Wrong" TestCaseStatusError TestCaseStatus = "Error" )