That’s a library script, not an event script. Library scripts don’t run unless an event calls a function within them. One of the events @Transistor listed.
Edit: Also note that when you have an event that calls Test.test(), the first time will yield two calls to test(), since you include a call at the top level of the library script. The top level runs once, to completion, the first time any member of it is accessed. (Like an auto-import.)
You need to be more precise in your writing. Your question title says "event script". I now suspect that you mean you have written it in the Project Library.
You can run a Project Library script from a button.
Right-click the button.
Select Configure Events ....
Select onActionPerformed, hit + and select Script.
If anyone else forgot like me - syntax of the path and name of the script is not as the project browser "copy path" feature gives - need to change slashes for dots.
So not Folder/Subfolder/Library_Script.method(args) but Folder.Subfolder.Library_Script.method(args)
Edit: Project browser tree copy path. Didn't know there was a similar tool in the script editor!
Thanks, yeah. Even without ctrl+space, 8.1 does propose completions if you start typing but if you paste an invalid path after copying one then it it does not.