How to test if a transaction can spend an existing output? Suppose I'm writing a transaction by hand, that spends an existing uspent output sent by myself from another address. Is there a way to test if the transaction can really spend that output, before brodcasting? The reason is, I want to be sure if I'm correctly generating the sigScript.

EDIT: I know it is possible to syntactically verify transactions, but I'm asking if do exists a method such as canSpend(myTransaction, unspentOutput). Ideally that would execute the combination of scripts myTransaction.sigScript and unspentOutput.ScriptPubKey and check if the result is true.
If you build Bitcoin Core from master, you can use the new testmempoolaccept rpc method to check if your tx would have made it into the mempool. This will include checking the signature, and ensuring that your inputs are actually unspent. It does not add broadcast the tx into the mempool, but simply checks if it would have been accepted.