Unit tests for linear and LinearFunction