File indexing completed on 2024-04-21 03:45:24

0001 #  SPDX-FileCopyrightText: 2009 Cies Breijs
0002 #  SPDX-FileCopyrightText: 2009 Niels Slot
0003 #
0004 #  SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 require File.dirname(__FILE__) + '/spec_helper.rb'
0007 $i = Interpreter.instance
0008 
0009 describe "variable assignment" do
0010   it "should be able to contain numbers" do
0011     $i.should_run_clean <<-EOS
0012       $x = 1
0013       $y = 1.2
0014       assert $x == 1
0015       assert $y == 1.2
0016     EOS
0017   end
0018 
0019   it "should be able to contain strings" do
0020     $i.should_run_clean <<-EOS
0021       $x = "string"
0022       $y = "kturtle"
0023       assert $x == "string"
0024       assert $y == "kturtle
0025     EOS
0026   end
0027 
0028   it "should be able to contain boolean values" do
0029     $i.should_run_clean <<-EOS
0030       $x = true
0031       $y = false
0032       assert $x == true
0033       assert $y == false
0034     EOS
0035   end
0036 
0037   it "should be able to be empty"
0038   it "should be usable mathmatical operators"
0039   it "should be usable in expressions"
0040   it "should change type automatically"
0041   it "should accept names according to the convention"
0042   it "should produce an error when not named according to the convention"
0043 end