Skip to content

Commit

Permalink
Merge branch 'master' into fix/reactivate-circleci-test_darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Mar 13, 2021
2 parents 1fc87f1 + 7aa9e98 commit 56c6189
Show file tree
Hide file tree
Showing 56 changed files with 323 additions and 492 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
- run: |
git clone https://github.com/crystal-lang/distribution-scripts.git ~/distribution-scripts
cd ~/distribution-scripts
git checkout 80c83b203e1ee2fd54e41398160a67c6a06d34e1
git checkout 4caf7cd337087e2ae313b8c7e00be247d34482ad
# persist relevant information for build process
- run: |
cd ~/distribution-scripts
Expand Down
12 changes: 7 additions & 5 deletions ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Submitting questions
---
name: "\U0001F41B Bug Report"
about: I want to report a bug.
labels: kind:bug
---

If you have a question like "how do I do X?", this is not the right place for asking it. Please ask on the [Crystal Forum](https://forum.crystal-lang.org), on our combined [Gitter](https://gitter.im/crystal-lang/crystal)/[IRC](http://webchat.freenode.net/?channels=#crystal-lang) or on [StackOverflow](http://stackoverflow.com/questions/tagged/crystal-lang).

# Submitting bugs
## Bug Report

Make sure to review these points before submitting issues - thank you!

- Make sure a similar issue doesn't exist yet: use the search box
- Make sure a similar issue does not exist yet: use the search box, search engine and look at [Stack Overflow](https://stackoverflow.com/questions/tagged/crystal-lang).
- **Include reproducible code**: we should be able to paste it into an editor, compile and run it and get the same error as you. Otherwise it's impossible for us to reproduce the bug.
- Don't **only** use `play.crystal-lang.org` or `carc.in`: code might be lost and the issue will remain incomplete. Write code in the issue itself.
- Reduce code, if possible, to the minimum size that reproduces the bug.
Expand Down
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: "\U00002753 Crystal Community Forum"
url: https://forum.crystal-lang.org/c/help-support
about: Questions about installing, using Crystal and any related issues.
- name: "\U0001F4AC Crystal Community Chat"
url: https://gitter.im/crystal-lang/crystal
about: "Get in touch with the community, ask for help and talk about Crystal. (IRC: #crystal-lang on freenode)"
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/discussion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: "\U0001F914 Language Improvement Discussion"
about: I want to start a new discussion about improving the language.
labels: status:discussion
---

## Discussion

- What aspect of the language would you like to see improved?
- What are the reasons?
- Include practical examples to illustrate your points.
- Optionally add one (or more) proposals to improve the current situation.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: "\U0001F680 Feature Request"
about: I want to propose a new language feature.
labels: kind:feature
---

## Feature Request

- Is your feature request related to a problem? Please describe clearly and concisely what is it.
- Describe the feature you would like, optionally illustrated by examples, and how it will solve the above problem.
- Describe considered alternative solutions, and the reasons why you have not proposed them as a solution here.
- Does it break backward compatibility, if yes then what's the migration path?
2 changes: 1 addition & 1 deletion samples/sdl/fire.cr
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class Screen
end

def put_pixel(point, color)
color = color.to_u32
color = color.to_u32!
offset = @surface.offset(point.x, point.y)
@surface[offset] = color

Expand Down
2 changes: 1 addition & 1 deletion samples/sdl/sdl/surface.cr
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SDL::Surface
end

def []=(offset, color)
(@surface.value.pixels.as(UInt32*))[offset] = color.to_u32
(@surface.value.pixels.as(UInt32*))[offset] = color.to_u32!
end

def []=(x, y, color)
Expand Down
46 changes: 25 additions & 21 deletions samples/sdl/tv.cr
Original file line number Diff line number Diff line change
Expand Up @@ -130,34 +130,38 @@ color_maker = ColorMaker.new(delay)
rects = parse_rectangles
puts "Rects: #{rects.size}"

while true
SDL.poll_events do |event|
if event.type == LibSDL::QUIT || event.type == LibSDL::KEYDOWN
ms = SDL.ticks - start
puts "#{frames} frames in #{ms} ms"
puts "Average FPS: #{frames / (ms * 0.001)}"
SDL.quit
exit
begin
while true
SDL.poll_events do |event|
if event.type == LibSDL::QUIT || event.type == LibSDL::KEYDOWN
ms = SDL.ticks - start
puts "#{frames} frames in #{ms} ms"
puts "Average FPS: #{frames / (ms * 0.001)}"
SDL.quit
exit
end
end
end

surface.lock
surface.lock

(height // 10).times do |h|
(width // 10).times do |w|
rect = rects.find { |rect| rect.contains?(w, h) }
10.times do |y|
10.times do |x|
surface[x + 10 * w, y + 10 * h] = rect ? (rect.light? ? color_maker.light_color : color_maker.dark_color) : color_maker.black_color
(height // 10).times do |h|
(width // 10).times do |w|
rect = rects.find { |rect| rect.contains?(w, h) }
10.times do |y|
10.times do |x|
surface[x + 10 * w, y + 10 * h] = rect ? (rect.light? ? color_maker.light_color : color_maker.dark_color) : color_maker.black_color
end
end
end
end
end

color_maker.next
color_maker.next

surface.unlock
surface.flip
surface.unlock
surface.flip

frames += 1
frames += 1
end
ensure
SDL.quit
end
8 changes: 4 additions & 4 deletions spec/compiler/codegen/macro_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ describe "Code gen: macro" do
)).to_string.should eq("Green")
end

it "says that enum has Flags attribute" do
it "says that enum has Flags annotation" do
run(%(
@[Flags]
enum Color
Expand All @@ -779,19 +779,19 @@ describe "Code gen: macro" do
Blue
end
{{Color.has_attribute?("Flags")}}
{{Color.annotation(Flags) ? true : false}}
)).to_b.should be_true
end

it "says that enum doesn't have Flags attribute" do
it "says that enum doesn't have Flags annotation" do
run(%(
enum Color
Red
Green
Blue
end
{{Color.has_attribute?("Flags")}}
{{Color.annotation(Flags) ? true : false}}
)).to_b.should be_false
end

Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/crystal/tools/doc/doc_renderer_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private def it_renders(context, input, output, file = __FILE__, line = __LINE__)
generator.type(program)
end
Doc::Markdown.parse input, Doc::Markdown::DocRenderer.new(c, io)
end.should eq(output), file, line
end.should eq(output), file: file, line: line
end
end

Expand Down
7 changes: 6 additions & 1 deletion spec/compiler/semantic/abstract_def_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ describe "Semantic: abstract def" do
Bar.new.foo(1 || 'a')
),
"no overload matches"
<<-MSG
Overloads are:
- Bar#foo(x : Int32)
Couldn't find overloads for these types:
- Bar#foo(x : Char)
MSG
end

it "errors if using abstract def on non-abstract class" do
Expand Down
2 changes: 1 addition & 1 deletion spec/std/compress/zlib/stress_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Compress::Zlib
describe Zlib do
it "write read should be inverse with random string" do
expected = String.build do |io|
1_000_000.times { rand(2000).to_i.to_s(32, io) }
1_000_000.times { rand(2000).to_i.to_s(io, 32) }
end

io = IO::Memory.new
Expand Down
6 changes: 3 additions & 3 deletions spec/std/http/client/client_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ module HTTP
client = TestClient.new "www.example.com"
request = HTTP::Request.new("GET", "/")
client.set_defaults(request)
request.host.should eq "www.example.com"
request.hostname.should eq "www.example.com"

request = HTTP::Request.new("GET", "/", HTTP::Headers{"Host" => "other.example.com"})
client.set_defaults(request)
request.host.should eq "other.example.com"
request.hostname.should eq "other.example.com"
end
end

Expand All @@ -288,7 +288,7 @@ module HTTP

io_request.rewind
request = HTTP::Request.from_io(io_request).as(HTTP::Request)
request.host.should eq("")
request.hostname.should eq("")
end

it "can specify host and port when initialized with IO" do
Expand Down
Loading

0 comments on commit 56c6189

Please sign in to comment.