Skip to content

Commit

Permalink
feat(cpp-versioning): add C++ 11, C++ 17 versioned concrete languages
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-herwana-nus committed Dec 20, 2024
1 parent 04495a1 commit ec43079
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
13 changes: 12 additions & 1 deletion lib/coursemology/polyglot/language/c_plus_plus.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
class Coursemology::Polyglot::Language::CPlusPlus < Coursemology::Polyglot::Language
# This is the old 'C++' programming language before proper version specifiers were added.
# It should not be removed before all associated submissions are migrated to the versioned languages.
syntax_highlighter 'cpp', ace: 'c_cpp'
concrete_language 'C/C++', docker_image: 'c_cpp'
concrete_language 'C/C++', docker_image: 'c_cpp:legacy'

class CPlusPlus11 < Coursemology::Polyglot::Language::CPlusPlus
concrete_language 'C++ 11', docker_image: 'c_cpp:11'
end

class CPlusPlus17 < Coursemology::Polyglot::Language::CPlusPlus
concrete_language 'C++ 17', docker_image: 'c_cpp:17'
end

end
2 changes: 1 addition & 1 deletion lib/coursemology/polyglot/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Coursemology; end
module Coursemology::Polyglot
VERSION = '0.3.10'.freeze
VERSION = '0.3.11'.freeze
end
12 changes: 12 additions & 0 deletions spec/coursemology/polyglot/language/c_plus_plus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@
expect(subject.class.display_name).to eq('C/C++')
end
end

describe Coursemology::Polyglot::Language::CPlusPlus::CPlusPlus11 do
it 'returns the correct display name' do
expect(subject.class.display_name).to eq('C++ 11')
end
end

describe Coursemology::Polyglot::Language::CPlusPlus::CPlusPlus17 do
it 'returns the correct display name' do
expect(subject.class.display_name).to eq('C++ 17')
end
end
end

0 comments on commit ec43079

Please sign in to comment.