|
573 | 573 | end |
574 | 574 | end |
575 | 575 |
|
576 | | - context "Writing a Statements" do |
| 576 | + context "Writing Statements" do |
577 | 577 | let(:statements) {[ |
578 | 578 | RDF::Statement(RDF::URI('s'), RDF::URI('p'), RDF::URI('o1')), |
579 | 579 | RDF::Statement(RDF::URI('s'), RDF::URI('p'), RDF::URI('o2')) |
|
600 | 600 | expect(writer.new.format_literal(RDF::Literal.new('Hello, world!'))).to eq '"Hello, world!"' |
601 | 601 | end |
602 | 602 |
|
| 603 | + it "should correctly format string literals" do |
| 604 | + expect(writer.new.format_literal(RDF::Literal.new('Hello, world!', datatype: RDF::XSD.string))).to eq '"Hello, world!"' |
| 605 | + end |
| 606 | + |
603 | 607 | it "should correctly format language-tagged literals" do |
604 | 608 | expect(writer.new.format_literal(RDF::Literal.new('Hello, world!', language: :en))).to eq '"Hello, world!"@en' |
605 | 609 | end |
|
858 | 862 | (0x20..0x21).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
859 | 863 | expect(writer.escape(0x22.chr, encoding)).to eq "\\\"" |
860 | 864 | (0x23..0x26).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
861 | | - expect(writer.escape(0x27.chr, encoding)).to eq "\\'" |
| 865 | + expect(writer.escape(0x27.chr, encoding)).to eq "'" |
862 | 866 | (0x28..0x5B).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
863 | 867 | expect(writer.escape(0x5C.chr, encoding)).to eq "\\\\" |
864 | 868 | (0x5D..0x7E).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
|
920 | 924 | (0x20..0x21).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
921 | 925 | expect(writer.escape(0x22.chr, encoding)).to eq "\\\"" |
922 | 926 | (0x23..0x26).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
923 | | - expect(writer.escape(0x27.chr, encoding)).to eq "\\'" |
| 927 | + expect(writer.escape(0x27.chr, encoding)).to eq "'" |
924 | 928 | (0x28..0x5B).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
925 | 929 | expect(writer.escape(0x5C.chr, encoding)).to eq "\\\\" |
926 | 930 | (0x5D..0x7E).each { |u| expect(writer.escape(u.chr, encoding)).to eq u.chr } |
|
0 commit comments