describe "yaml string", -> it "should create basic yaml string", -> s = | hello world assert.is_true s\match "hello" assert.is_true s\match "world" it "should preserve indentation", -> s = | key1: value1 key2: value2 assert.is_true s\match "key1" assert.is_true s\match "key2" it "should support interpolation", -> name = "test" s = | hello #{name} assert.same s, "hello test" it "should handle complex interpolation", -> x, y = 10, 20 s = | point: x: #{x} y: #{y} assert.is_true s\match "x: 10" assert.is_true s\match "y: 20" it "should work with expressions", -> s = | result: #{1 + 2} assert.is_true s\match "result: 3" it "should support multiline with variables", -> config = | database: host: localhost port: 5432 name: mydb assert.is_true config\match "database:" assert.is_true config\match "host:" it "should escape special characters", -> s = | path: "C:\Program Files\App" note: 'He said: "#{Hello}!"' assert.is_true s\match "path:" assert.is_true s\match "note:" it "should work in function", -> fn = -> str = | foo: bar: baz return str result = fn! assert.is_true result\match "foo:" assert.is_true result\match "bar:" it "should strip common leading whitespace", -> fn = -> s = | nested: item: value s result = fn! assert.is_true result\match "nested:" assert.is_true result\match "item:" it "should support empty lines", -> s = | line1 line3 assert.is_true s\match "line1" assert.is_true s\match "line3" it "should work with table access in interpolation", -> t = {value: 100} s = | value: #{t.value} assert.is_true s\match "value: 100" it "should support function calls in interpolation", -> s = | result: #{(-> 42)!} assert.is_true s\match "result: 42" it "should handle quotes correctly", -> s = | "quoted" 'single quoted' assert.is_true s\match '"quoted"' assert.is_true s\match "'single quoted'" it "should work with multiple interpolations", -> a, b, c = 1, 2, 3 s = | values: #{a}, #{b}, #{c} assert.is_true s\match "values: 1, 2, 3" it "should preserve newlines", -> s = | first line second line third line lines = [line for line in s\gmatch "[^\n]+"] assert.same #lines, 3