Sha256: 4181e5293f81829211995ce5a2dd52d758f69943ede5b9beadf1b30b23a50198

Contents?: true

Size: 585 Bytes

Versions: 5

Compression:

Stored size: 585 Bytes

Contents

require 'spec_helper'

describe Qlang do
  describe 'Function' do
    it do
      expect(
        Q.compile('f(x, y) = x + y')
      ).to eq(
        "f <- function(x ,y) x + y"
      )

      expect(
        Q.compile('g(x) = x ** 2')
      ).to eq(
        "g <- function(x) x ** 2"
      )

      expect(
        Q.compile('g(x) = x ** (2 + 2)')
      ).to eq(
        "g <- function(x) x ** (2 + 2)"
      )

      expect(
        Q.compile('h(a, b, c) = a ** 2 + b ** 2 + c ** 2')
      ).to eq(
        "h <- function(a ,b ,c) a ** 2 + b ** 2 + c ** 2"
      )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qlang-0.0.14142 spec/function_spec.rb
qlang-0.0.1414 spec/function_spec.rb
qlang-0.0.141 spec/function_spec.rb
qlang-0.0.14 spec/function_spec.rb
qlang-0.0.1 spec/function_spec.rb