Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fc1943s committed Jun 2, 2024
1 parent e5e1b3a commit 59f5779
Show file tree
Hide file tree
Showing 24 changed files with 608 additions and 534 deletions.
2 changes: 1 addition & 1 deletion apps/builder/Builder.dib
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ let inline persistCodeProject packages modules name hash code = async {
let workspaceRoot = SpiralFileSystem.get_workspace_root ()

let targetDir =
let targetDir = workspaceRoot </> "target/polyglot/builder" </> name
let targetDir = workspaceRoot </> "target/Builder" </> name
match hash with
| Some hash -> targetDir </> "packages" </> hash
| None -> targetDir
Expand Down
2 changes: 1 addition & 1 deletion apps/plot/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn draw_line_plot(
fn main() -> Result<(), Box<dyn std::error::Error>> {
let workspace_root = plot::SpiralFileSystem::get_workspace_root();
let workspace_root = std::path::PathBuf::from(workspace_root.to_string());
let tmp_spiral_dir = workspace_root.join("target/polyglot/plotting");
let tmp_spiral_dir = workspace_root.join("target/plot");
let line_plots_data_dir = tmp_spiral_dir.join("line_data");
let line_plots_svg_dir = tmp_spiral_dir.join("line_svg");

Expand Down
2 changes: 1 addition & 1 deletion apps/spiral/Eval.dib
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ let inline mapErrors (severity, errors, lastTopLevelIndex) allCode =
#!fsharp

let workspaceRoot = SpiralFileSystem.get_workspace_root ()
let targetDir = workspaceRoot </> "target/polyglot/spiral_eval"
let targetDir = workspaceRoot </> "target/spiral_Eval"
[ targetDir ]
|> List.iter (fun dir -> if Directory.Exists dir |> not then Directory.CreateDirectory dir |> ignore)

Expand Down
2 changes: 1 addition & 1 deletion apps/spiral/Supervisor.dib
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ let inline buildFile timeout port cancellationToken path = async {
#!fsharp

let inline persistCode code = async {
let targetDir = workspaceRoot </> "target/polyglot/spiral_eval"
let targetDir = workspaceRoot </> "target/spiral_Eval"

let packagesDir = targetDir </> "packages"

Expand Down
2 changes: 1 addition & 1 deletion apps/spiral/builder/spiral_builder.dib
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ inl persist_code_project packages modules name hash code =

inl workspace_root = file_system.get_workspace_root ()
inl target_dir =
inl target_dir = workspace_root </> "target/polyglot/spiral_builder" </> name
inl target_dir = workspace_root </> "target/spiral_builder" </> name
match hash with
| Some hash => target_dir </> "packages" </> hash
| None => target_dir
Expand Down
2 changes: 1 addition & 1 deletion lib/fsharp/Plotting.dib
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ open SpiralFileSystem.Operators
#!fsharp

let workspaceRoot = SpiralFileSystem.get_workspace_root ()
let tmpSpiralPath = workspaceRoot </> "target/polyglot/plotting"
let tmpSpiralPath = workspaceRoot </> "target/plot"
let linePlotsDataPath = tmpSpiralPath </> "line_data"
let linePlotsSvgPath = tmpSpiralPath </> "line_svg"

Expand Down
8 changes: 3 additions & 5 deletions lib/spiral/am'.dib
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open rust_operators

#!markdown

## types ()
## types

#!spiral

Expand Down Expand Up @@ -725,12 +725,10 @@ inl any forall t. (fn : t -> bool) (source : array_base t) : bool =

#!spiral

open iter_prototypes

instance iter_collect vec = fun (iter : iter_prototypes.into_iterator u) =>
instance iter_collect vec = fun (iter : into_iterator u) =>
!\($'"!iter.collect::<Vec<_>>()"')

instance iter_collect'' vec = fun (iter : iter_prototypes.into_iterator (t (u v))) =>
instance iter_collect'' vec = fun (iter : into_iterator (t (u v))) =>
!\($'"!iter.collect::<Vec<_>>()"')

#!markdown
Expand Down
8 changes: 3 additions & 5 deletions lib/spiral/am'.spi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// # am'
open rust_operators

/// ## types ()
/// ## types
inl types () =
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"[$0]\")>]\n#endif\ntype Slice<'T> = class end"
global "#if FABLE_COMPILER\n[<Fable.Core.Erase; Fable.Core.Emit(\"_\")>]\n#endif\ntype Slice'<'T> = class end"
Expand Down Expand Up @@ -332,12 +332,10 @@ inl any forall t. (fn : t -> bool) (source : array_base t) : bool =
!\($'"!source.any(|x| !fn(x))"')

/// ## iter_collect vec
open iter_prototypes

instance iter_collect vec = fun (iter : iter_prototypes.into_iterator u) =>
instance iter_collect vec = fun (iter : into_iterator u) =>
!\($'"!iter.collect::<Vec<_>>()"')

instance iter_collect'' vec = fun (iter : iter_prototypes.into_iterator (t (u v))) =>
instance iter_collect'' vec = fun (iter : into_iterator (t (u v))) =>
!\($'"!iter.collect::<Vec<_>>()"')

/// ## new_vec
Expand Down
3 changes: 3 additions & 0 deletions lib/spiral/am'_prototypes.spi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// ### array
inl array x =
x
Loading

0 comments on commit 59f5779

Please sign in to comment.