mirror of
https://github.com/Smaug123/WoofWare.Expect
synced 2025-10-05 20:48:40 +00:00
23 lines
555 B
Forth
23 lines
555 B
Forth
namespace WoofWare.Expect.Test
|
|
|
|
open System
|
|
open System.IO
|
|
open System.Reflection
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module Assembly =
|
|
|
|
let getEmbeddedResource (assembly : Assembly) (name : string) : string =
|
|
let names = assembly.GetManifestResourceNames ()
|
|
|
|
let names =
|
|
names |> Seq.filter (fun s -> s.EndsWith (name, StringComparison.Ordinal))
|
|
|
|
use s =
|
|
names
|
|
|> Seq.exactlyOne
|
|
|> assembly.GetManifestResourceStream
|
|
|> fun s -> new StreamReader (s)
|
|
|
|
s.ReadToEnd ()
|