Help With This Code Crash Just Trying To Compile

Could I get some help as I’ve apparently exceeded my current AppleScript knowledge; SD7 crashes even trying to compile the test program. It’s a trivial program “class” and its associated ASUnit test.

I’d hope it was just something silly on my part, but unused to programs crashing just from compilation. Ideas?

$ osacompile -o test_date.scpt -x test_date.applescript
Segmentation fault: 11

date.applescript (901 Bytes)

test_date.applescript (2.9 KB)

ASUnit not included, but hopefully programmers were already testing their code and have it installed. It’s like JUnit, but for AppleScript.

ASUnit GitHub repository

What is asunit? I tried to look it up but all articles say it’s for action script not Apple script.

It did not work for me at that time. So, I don’t care about it.

I feel that every once in a while, a piece of software comes along that looks big and complex, yet is completely useless.

@robertfern, the GutHub repository link to ASUnit was included. I’ll edit the post to make that more apparent though.

Yes, but what is it? And are you sure it works with Apple script?

It is quite literally AppleScript.

@alldritt , you have any ideas why a compile would cause an SD7 SEGV crash?

The problem is here:

use ASUnit : script "com.lifepillar/ASUnit"
property parent : ASUnit

This creates a circular parent chain that causes the AppleScript compiler to infinitely recur and crash. Rewrite it like this, as shown in the GitHub readme, and you should be okay:

property parent : script "com.lifepillar/ASUnit"