Skip to content

Commit

Permalink
refactor: Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonFrai committed Aug 28, 2024
1 parent 0a6d1ec commit 5bcf313
Show file tree
Hide file tree
Showing 35 changed files with 267 additions and 141 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<BumpedVersion>0.5.0-alpha</BumpedVersion>
<BumpedVersion>0.6.0-alpha</BumpedVersion>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Extensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open System
open System.Threading

open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


[<RequireQualifiedAccess>]
Expand Down
20 changes: 10 additions & 10 deletions src/FSharp.Control.Futures/FSharp.Control.Futures.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@

<ItemGroup>
<Compile Include="Types.fs" />
<Compile Include="Internals\Utils.fs" />
<Compile Include="Internals\Future.fs" />
<Compile Include="Internals\IntrusiveList.fs" />
<Compile Include="Internals\Helpers.fs" />
<Compile Include="Internals\NaiveFuture.fs" />
<Compile Include="Internals\PrimaryMerge.fs" />
<Compile Include="Internals\PrimaryNotify.fs" />
<Compile Include="Internals\PrimaryOnceCell.fs" />
<Compile Include="Internals\Futures.fs" />
<Compile Include="Internals\FuseFuture.fs" />
<Compile Include="LowLevel\Utils.fs" />
<Compile Include="LowLevel\Future.fs" />
<Compile Include="LowLevel\IntrusiveList.fs" />
<Compile Include="LowLevel\Helpers.fs" />
<Compile Include="LowLevel\NaiveFuture.fs" />
<Compile Include="LowLevel\PrimaryMerge.fs" />
<Compile Include="LowLevel\PrimaryNotify.fs" />
<Compile Include="LowLevel\PrimaryOnceCell.fs" />
<Compile Include="LowLevel\Futures.fs" />
<Compile Include="LowLevel\FuseFuture.fs" />
<Compile Include="Future.fs" />
<Compile Include="Extensions.fs" />
<Compile Include="Mailbox\Reply.fs" />
Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.Control.Futures/Future.fs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
namespace FSharp.Control.Futures

open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


/// <summary>
///
/// </summary>
/// <remarks>
/// `poll` and `drop` are not userspace functions.
/// Low-level functions must be defined in there namespace: <see cref="FSharp.Control.Futures.Internals"/>.
/// Low-level functions must be defined in there namespace: <see cref="FSharp.Control.Futures.LowLevel"/>.
/// </remarks>
[<RequireQualifiedAccess>]
module Future =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open System
open FSharp.Control.Futures
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open FSharp.Control.Futures

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open FSharp.Control.Futures

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open FSharp.Control.Futures

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel


[<AllowNullLiteral>]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open FSharp.Control.Futures

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open FSharp.Control.Futures

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open System
open System.Threading
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open FSharp.Control.Futures

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace FSharp.Control.Futures.Internals
namespace FSharp.Control.Futures.LowLevel

open System.Diagnostics

Expand All @@ -17,6 +17,9 @@ module Utils =
let inline unreachable () =
raise (UnreachableException())

let inline unreachableS msg =
raise (UnreachableException(msg))


type [<Struct>] ExnResult<'a> =
val value: 'a
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Mailbox/Mailbox.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace FSharp.Control.Futures.Mailbox

open System.Threading
open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


exception MailboxMultipleReceiveAtSameTimeException
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Mailbox/Reply.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace FSharp.Control.Futures.Mailbox

open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace FSharp.Control.Futures.Runtime.LowLevel
open System
open System.Diagnostics
open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel
open FSharp.Control.Futures.Runtime.LowLevel
open FSharp.Control.Futures.Runtime
open Microsoft.FSharp.Core
Expand Down
10 changes: 6 additions & 4 deletions src/FSharp.Control.Futures/Runtime/Runtimes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ namespace FSharp.Control.Futures.Runtime

open FSharp.Control.Futures.Runtime.ThreadPoolRuntime

[<RequireQualifiedAccess>]
module ThreadPoolRuntime =
let instance = ThreadPoolRuntime.Instance
let inline spawn fut = Runtime.spawn ThreadPoolRuntime.Instance fut
[<AutoOpen>]
module ThreadPoolRuntimePrelude =
[<RequireQualifiedAccess>]
module ThreadPoolRuntime =
let instance = ThreadPoolRuntime.Instance
let inline spawn fut = Runtime.spawn ThreadPoolRuntime.Instance fut
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace rec FSharp.Control.Futures.Runtime.ThreadPoolRuntime
namespace FSharp.Control.Futures.Runtime.ThreadPoolRuntime

open System
open System.Diagnostics
Expand All @@ -9,6 +9,7 @@ open FSharp.Control.Futures.Runtime.LowLevel


[<Class>]
[<Sealed>]
type ThreadPoolFutureTask<'a>(fut: Future<'a>) =
inherit AbstractFutureTask<'a>(fut)

Expand All @@ -22,6 +23,7 @@ type ThreadPoolFutureTask<'a>(fut: Future<'a>) =


[<Class>]
[<Sealed>]
type ThreadPoolRuntime private () =

static member Instance: IRuntime = new ThreadPoolRuntime()
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Sync/Monitor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace rec FSharp.Control.Futures.Sync

open System.Threading
open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel
open FSharp.Control.Futures


Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Sync/Mutex.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace rec FSharp.Control.Futures.Sync

open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


// =======
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Sync/OnceVar.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace rec FSharp.Control.Futures.Sync

open System.Threading
open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


exception IVarDoublePutException
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Sync/WaitHandle.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace FSharp.Control.Futures.Sync

open System.Threading
open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel

type WaitHandle() = class end

Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Control.Futures/Transforms.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module FSharp.Control.Futures.Transforms
open System
open System.Threading
open FSharp.Control.Futures
open FSharp.Control.Futures.Internals
open FSharp.Control.Futures.LowLevel


[<AutoOpen>]
Expand Down
Loading

0 comments on commit 5bcf313

Please sign in to comment.