Ed Dyreen wrote:What I didn't mention is that when the macro definition is updated, the library detects the cache is different from the definition and performs a unitTest. So manual unitTesting is no longer required. The unitTest must succeed or script execution is suspended until the error is resolved.OperatorGK wrote:Library including itself by changing the original environment?
I'm developing a similar library, but I'm doing it the other way. My solution is remove the string "call library" and place the actual function library text at the end of batch file using (goto) 2>nul GetCaller trick + on-fly batch file modification. But now it don't work with each other really well . This way has it own pros and cons:
+ Fast including
+ Allows using call :function syntax instead of macros
+ Easily modifiable
- Updating it to all batch files is pain
- General call slowness
BTW. I'm from Russia, so I'll use GOST R 34.10-2012 if I'll need to cipher something really important and government-related.
I can see what u mean, the good news is that the (goto) trick is not required to get it to work like that. I've done similar in the past by scanning for macro's and functions and appending them.
(goto) is only needed for cosmetical uses, specifically for this:
Code: Select all
import mylib.bat
instead of this:
Code: Select all
import mylib.bat %0
I've done the test "%0" version, but this syntax is long, annoying and unlogical. Also, it takes a long time to write string-safe code, so test prototype need reworking.
Also, when you'll finish your batch unit test system, will you publish it? Cuz if there are string-safety testing functions, I'll be very happy.