fn test_unicode_characters() {
	unicode := '😀😆😎💻🌎'
	println(unicode)
	println(unicode.len)
}

fn test_string_len() {
	a := 'a'
	b := 'ab'
	c := 'abc'
	d := 'abcd'

	println(a.len)
	println(b.len)
	println(c.len)
	println(d.len)
}

struct Idx {
        a string
}

fn test_string_index() {
	a := '1234'
	assert a[0] == `1`
	assert a[1] == `2`
	assert a[2] == `3`
	assert a[3] == `4`
	assert a[0] != `0`
	assert a[1] != `0`
	assert a[2] != `0`
	assert a[3] != `0`
	
	x := Idx{'abc'}
	assert x.a[1] == `b`
	assert x.a[2] != `b`
}

fn test_for_i_in_len() {
	s := 'abc'
	for i := 0; i < s.len; i++ {
		println(s[i])
	}
}

fn test_escape_codes() {
	star1 := '\xe2\x98\x85'
	println(star1)
	println(star1.len)
	star2 := '\u2605'
	println(star2)
	println(star2.len)
	star3 := '\U00002605'
	println(star3)
	println(star3.len)

	aaa := '\x61\141a'
	println(aaa)
	println(aaa.len)

	tab_newln := '##\t#\n###\t#'
	println(tab_newln)
	println(tab_newln.len)
}

fn test_raw_string() {
	raw := r'hello\tworld\n'
	println(raw)
}

fn test_runes() {
	mut a := `V`
	println(a)

	a = `😀`
	println(a)

	rocket := `🚀`
	println(rocket)

	// should all print `★`
	print(`\u2605`)
	print(`\U00002605`)
	print(`\xe2\x98\x85`)
	println(`\xe2\x98\x85`)
}

const a = 'my string'

fn const_test() {
	b := a
	println(b)
}

fn main() {
	test_unicode_characters()
	test_string_len()
	test_string_index()
	test_for_i_in_len()
	test_escape_codes()
	test_raw_string()
	test_runes()
	const_test()
}
