File-like option where the "file contents" comes from a string?

Ali Çehreli acehreli at yahoo.com
Wed Nov 27 02:43:21 UTC 2024


On 11/26/24 5:12 PM, Andy Valencia wrote:
> Again and again for testing I run into how nice it would be to have an 
> open "File" which has its contents set by the unit test code:
> 
>> auto f = StringFile("my test data...", "r");
> 
> I've searched high and low without discovering something which would fit 
> the bill.
> 
> Thanks in advance,
> Andy
> 

An earlier post by H. S. Teoh may be helpful:

  
https://forum.dlang.org/post/mailman.10192.1685482943.31357.digitalmars-d@puremagic.com

Ali


More information about the Digitalmars-d-learn mailing list