Sha256: a71a61241974ae516820396c4a36d71aca426cd895d15584df189a18b9a19e59

Contents?: true

Size: 820 Bytes

Versions: 7

Compression:

Stored size: 820 Bytes

Contents

require 'spec_helper'

describe Qlang do
  describe 'Vector' do
    context 'into R' do
      it do
        expect(
          Q.to_r.compile('(1 2 3)')
        ).to eq(
          "c(1, 2, 3)"
        )

        expect(
          Q.to_r.compile('(1 2 3 4 5 6)')
        ).to eq(
          "c(1, 2, 3, 4, 5, 6)"
        )

        expect(
          Q.to_r.compile('(1   2    3  4      5   6)')
        ).to eq(
          "c(1, 2, 3, 4, 5, 6)"
        )
      end
    end

    context 'into Ruby' do
      it do
        expect(
          Q.to_ruby.compile('(1 2 3)')
        ).to eq(
          "Vector[1, 2, 3]"
        )
      end
    end

    context 'into Python' do
      it do
        expect(
          Q.to_python.compile('(1 2 3)')
        ).to eq(
          "array([1, 2, 3])"
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
qlang-0.0.27182123 legacy_rspec/objects/vector_spec.rb
qlang-0.0.27182122 legacy_rspec/objects/vector_spec.rb
qlang-0.0.27182121 legacy_rspec/objects/vector_spec.rb
qlang-0.0.27182120 legacy_rspec/objects/vector_spec.rb
qlang-0.0.27182110 legacy_rspec/objects/vector_spec.rb
qlang-0.0.27182100 legacy_rspec/objects/vector_spec.rb
qlang-0.0.27182000 spec/objects/vector_spec.rb